How can i install a local rpm using puppet -
i trying install particular rpm using puppet, init.pp is:
class nmap { package {'nmap': provider => 'rpm', source => "<local path rpm>", } }
and rpm in ...modules/nmap/files
if move rpm manifests, , provide rpm name in source => ''
class nmap { package {'nmap': provider => 'rpm', source => "rpm-name.rpm", } }
it works, how can specify source path ../files/
, puppet apply successfully
when use :
source => 'puppet:///files/nmap-6.45-1.x86_64.rpm',
i error:
debug: executing '/bin/rpm -i puppet:///files/nmap-6.45-1.x86_64.rpm'
error: execution of '/bin/rpm -i puppet:///files/nmap-6.45-1.x86_64.rpm' returned 1: error: open of puppet:///files/nmap-6.45-1.x86_64.rpm failed: no such file or directory
error: /stage[main]/nmap/package[nmap]/ensure: change absent present failed: execution of '/bin/rpm -i puppet:///files/nmap-6.45-1.x86_64.rpm' returned 1: error: open of puppet:///files/nmap-6.45-1.x86_64.rpm failed: no such file or directory
`
when running command:
sudo puppet apply --modulepath=/home/user1/qa/puppet_qa/modules/ -e "include nmap" --debug
unlike file resource type, package type has no support puppet fileserver urls. need use file
resource download rpm
prior installing it. if recurring problem you, make defined type
in 1 go (think macros), e.g.
define fileserver_package($source, $ensure='installed') { file { "/my/tmp/dir/$name.rpm": source => $source } package { $name: ensure => $ensure, provider => 'rpm', source => "/my/tmp/dir/$name.rpm", require => file["/my/tmp/dir/$name.rpm"], } }
edit: advisable use local yum repo instead, see first comment @rojs below.
Comments
Post a Comment