puppet でコマンド zypper を使用して、複数のパッケージをインストールしたいと考えています。独自のリポジトリを作成し、そこにいくつかの bacula パッケージをダンプしました。私のマニフェストは次のとおりです。
#cat manifests/init.pp
class bacula()
{
$baculas = [ "bacula-dir", "bacula-fd", "bacula-bat", "bacula-bconsole", "bacula- catalog-postgresql", "bacula-libs", "bacula-postgresql", "bacula-sd", "bacula-sql", "bacula-tools", "bacula-updatedb" ]
package { $baculas: ensure => "installed" }
exec { 'install_bacula':
provider => shell,
path => [ "/bin/", "/usr/bin", "/sbin" ],
command => "/usr/bin/zypper -n in $baculas;",
logoutput => on_failure,
}
}
パッケージは正常にインストールされましたが、出力にエラーがあります。パッケージの名前が連結され、パペットがそのような長いパッケージ名を見つけることができないというエラーを返したようです。以下の出力:
# puppet agent --test
info: Caching catalog for otoyas
info: Applying configuration version '1418720157'
notice: /Stage[main]/Bacula/Package[bacula-dir]/ensure: created
notice: /Stage[main]/Bacula/Package[bacula-sd]/ensure: created
notice: /Stage[main]/Bacula/Package[bacula-fd]/ensure: created
notice: /Stage[main]/Bacula/Exec[install_bacula]/returns: Loading repository data...
notice: /Stage[main]/Bacula/Exec[install_bacula]/returns: Reading installed packages...
notice: /Stage[main]/Bacula/Exec[install_bacula]/returns: 'bacula-dirbacula-fdbacula-batbacula-bconsolebacula-catalog-postgresqlbacula-libsbacula-postgresqlbacula-sdbacula-sqlbacula-toolsbacula-updatedb' not found in package names. Trying capabilities.
notice: /Stage[main]/Bacula/Exec[install_bacula]/returns: No provider of 'bacula-dirbacula-fdbacula-batbacula-bconsolebacula-catalog-postgresqlbacula-libsbacula-postgresqlbacula-sdbacula-sqlbacula-toolsbacula-updatedb' found.
err: /Stage[main]/Bacula/Exec[install_bacula]/returns: change from notrun to 0 failed: /usr/bin/zypper -n in bacula-dirbacula-fdbacula-batbacula-bconsolebacula-catalog-postgresqlbacula-libsbacula-postgresqlbacula-sdbacula-sqlbacula-toolsbacula-updatedb; returned 104 instead of one of [0] at /etc/puppet/modules/bacula/manifests/init.pp:12
notice: /Stage[main]/Bacula/Package[bacula-bat]/ensure: created
notice: /Stage[main]/Bacula/Package[bacula-updatedb]/ensure: created
notice: /Stage[main]/Vsftpd/Exec[install_vsftpd]/returns: executed successfully
notice: /Stage[main]/Bacula/Package[bacula-tools]/ensure: created
notice: /Stage[main]/Bacula/Package[bacula-postgresql]/ensure: created
notice: Finished catalog run in 6.28 seconds
これを修正するにはどうすればよいですか? このタスクを実行するためのより良い方法があれば、パペットを初めて使用するので、提案をお待ちしています。
ありがとう。