In Puppet, the source attribute in package type allow us to install a .rpm package by providing the file path located in the agent machine. But in that case, the package name should be the same as the .rpm filename. Otherwise, you will get following error.
package oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64 is already installed
Here is an example of the Puppet manifest.
#package { "oracle-instantclient": <-- this will cause error in every daemon run package { "oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64": ensure => installed, provider => 'rpm', source => '/tmp/oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm', require => File["/tmp/oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm"], }
Done =)
Reference: Ensure package installed fails if it is installed
This helped me out until I needed to upgrade a package with a newer version. I suggest putting the version number in the ‘ensure’ value as described here: http://ask.puppetlabs.com/question/14194/rpm-packages/?answer=14200#post-id-14200
LikeLike
Yes, it’s better to specify a version number if you have multiple versions. Thanks for your comment. =)
LikeLike
It works! Thank you 😀
LikeLike