Can I use wildcards is puppet package ensure to cover multiple releaseversion

Rob van den Eijnde asked:

Using puppet I want to update packages on my (CentOS 5 & 6 servers) in a controlled way. Therefore I don’t want to use ensure=>latest but rather ensure=>3.0.1-1.

Example:

class puppet::installation inherits puppet {
        package { "puppet":
            ensure => "3.0.1-1",
        }
}

The update works alright but puppet agent keeps complaining that there is a difference:

/Stage[main]/Puppet::Installation/Package[puppet]/ensure: current_value 3.0.1-1.el6, should be 3.0.1-1 (noop)

I can solve this by changing the ensure rule to 3.0.1-1.el6 but than that won’t work on CentOS 5.

Is there a short/clean way to solve this or do I have to write to seperate, os-releaseversion dependant rules.

I have been googling for a solution but didn’t find anything pertaining to this particular question.

Any suggestion or reference to a relevant example would be appreciated.

My answer:


Puppet really doesn’t have any functionality for this yet (though they really need it).

You can use the yum-versionlock yum plugin to lock specific RPM packages at specific versions, and then use puppet to control the versionlock configuration.

For some other workarounds, see this related question.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.