Puppet install multiple packages using zypper command - packages names got concatenated -


i install multiple packages using command zypper puppet. created own repository , dumped bacula packages in there. manifest follows:

#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, } } 

while packages got installed fine, there error in output. seems packages' names got concatenated , puppet returned error not being able find such lengthy package name. output below:

# puppet agent --test info: caching catalog 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 notrun 0 failed: /usr/bin/zypper -n in bacula-dirbacula-fdbacula-batbacula-bconsolebacula-catalog-postgresqlbacula-libsbacula-postgresqlbacula-sdbacula-sqlbacula-toolsbacula-updatedb; returned 104 instead of 1 of [0] @ /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 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 

how fix this? if there better way perform task, open suggestions since new puppet.

thanks.

yes, approach flawed.

you should leave gory details of how invoke zypper puppet. don't use exec type unless absolutely necessary. packages, use package instead.

package {     $baculas:         ensure   => 'installed',         provider => 'zypper', } 

actually, puppet should pick zypper provider on own, if you're on suse system. dropping exec might trick already.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -