Ask Your Question
0

rpm command in puppet

asked 2015-04-24 06:31:30 -0500

Chutki gravatar image

Hi,

I am working on mcafee installation. I downloaded zip file from someother tool and keep it in modules/files directory. In that zip file there is a scipt called mcafee_insatall. this script will install mcafee rpm's. I am converting that into puppet

Below is the manifests

exec {'install_sw':
    cwd     => 'mcafee/puppet/test/downloaded',
    command => ./install.sh -i ",
    onlyif  => "/usr/bin/test -e /mcafee/puppet/test/downloaded"
  }

manifests working but if rerun, it failed with below error

change from notrun to 0 failed: ./install.sh -i  returned 1 instead of one of [0]

because the rpm already installed , so "exec" resources not installing again. so I should change my onlyif like if rmp -qa MF* already exist the command should run else it should not execute

is there any option in puppet

I can't use pacakge resource because that mcafee package is not available in linux repo. I should go with install script only.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-04-24 08:33:55 -0500

JohnsonEarls gravatar image

updated 2015-04-24 08:37:54 -0500

If you know the names of all the rpms to be installed, and that's all the install.sh script does, then you can use the package resource:

package { 'MFfoobar':
    provider => 'rpm' ,
    ensure => 'installed' ,
    source => '/.../.../MFfoobar-version-release.arch.rpm'
}

If the install script does other things, then you can use the unless parameter to exec:

exec {'install_sw':
    cwd     => 'mcafee/puppet/test/downloaded',
    command => "./install.sh -i ",
    unless => "rpm -q MFfoobar-version-release"
}
edit flag offensive delete link more

Comments

Thanks. It worked

Chutki gravatar imageChutki ( 2015-04-24 14:37:15 -0500 )edit
0

answered 2015-06-10 18:14:32 -0500

chanti gravatar image

Thank you very much! :)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-04-24 06:31:30 -0500

Seen: 1,077 times

Last updated: Apr 24 '15