Puppet yum repo – Pull down 2.7.x vs 3.0.x

Mike Purcell asked:

So a few weeks ago I started on the path to using puppet to automate all the configs/services. At the time I was using the EPEL repo, which installed version 2.6.x. After some reading I was trying to gain access to the flatten method available via the puppet stdlib, and thought it was available by default in the newer 2.7.x version. So I added a puppet repo with the following settings:

[puppetlabs]
name=Puppet Labs Packages
baseurl=http://yum.puppetlabs.com/el/$releasever/products/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs

The problem with this, is it installed v3.0.x instead of 2.7.x. And apparently 3.0.x is a major upgrade which was released only a few weeks ago. Obviously I would prefer to use the 2.7.x for the next few months while PuppetLabs fix any defects which will inevitably arise after a major version.

So my question is, what setting can I add to the puppet repo config to pull down only the 2.7.x branch and not the 3.0.x branch?

My answer:


Use the yum-versionlock plugin to lock the package version to what you want:

yum install yum-versionlock

To continue:

If you have already installed puppet

Now edit /etc/yum/pluginconf.d/versionlock.list and specify the version you want:

puppet 2.7.19
puppet-server 2.7.19

Finally install it. Depending on your current situation, use only one of:

yum upgrade puppet
yum downgrade puppet
yum distro-sync

If you have not already installed puppet

Install a specific version of puppet:

yum install puppet-2.7.19
yum install puppet-server-2.7.19

Lock the package version to the currently installed version:

yum versionlock puppet
yum versionlock puppet-server

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.