使用 puppet 安装依赖包

使用 puppet 安装依赖包

我是新手puppet,在学习过程中,我创建Puppet MasterPuppet Slave设置并配置了一个mysql模块来在上安装 mysql Puppet client。下面是清单文件。

class mysql {
    package { ["mysql-server-5.5", "libaio1", "libdbd-mysql-perl", "libdbi-perl", "libhtml-template-perl", "libmysqlclient18", "mysql-client-5.5", "mysql-common", "mysql-server-core-5.5"]:
    ensure => present,
    allowcdrom => 'true',
    }
}

package资源包含 mysql-server 的所有依赖项。但我收到以下错误。

Building dependency tree...
Reading state information...
The following extra packages will be installed:
  mysql-common
The following NEW packages will be installed:
  libmysqlclient18 mysql-common
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 738 kB of archives.
After this operation, 3513 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  mysql-common libmysqlclient18
E: There are problems and -y was used without --force-yes
Error: /Stage[main]/Mysql/Package[libmysqlclient18]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libmysqlclient18' returned 100: Reading package lists...

我也尝试添加install_options: "--force-yes"错误输出中提到的内容,但仍然遇到同样的问题。

任何帮助都将受到感谢。

答案1

您可以尝试以下清单。问题是您必须添加-f--allow-unauthenticated选项才能apt-get自动解析依赖项并安装它们。添加这些标志后,无需将每个依赖包都添加到资源中package

class mysql {
    package { ["mysql-server-5.5"]:
    ensure => present,
    allowcdrom => 'true',
    install_options => ['--allow-unauthenticated', '-f'],
    }
}

相关内容