From f924a8bb5b5d081e70d05721ae7225e19db58843 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Mon, 10 Apr 2017 14:15:57 +0200 Subject: [PATCH] Remove puppet pinning logic During the transition from puppet 2.7 to puppet 3.x we needed to add logic to carefully select what versions of puppet and related packages would be installed from the puppetlabs apt and yum repositories. Before puppet 4 was announced, we rightfully feared accidentally upgrading to backwards-incompatible versions of these packages and breaking the world. Now we are completely off of puppet 2.7, so we don't need to keep any remnants of that around. Moreover, the new packaging system for puppet 4 will make it impossible to accidentally upgrade[1]. The package name has changed from "puppet" to "puppet-agent", which has facter and hiera etc. bundled into the same package, and in order to get the new package we must add a new "puppet collections" repository. So, not only is this pinning logic not needed to keep us safe, it is also not going to be useful when we upgrade to puppet 4. Looking at the puppetlabs repositories[2][3] we are already using the latest version of the packages we are pinning and Puppet is definitely not going to add new versions to these repositories. The $puppet_version variable was leftover from when puppet.conf was managed by puppet and not ansible so this patch cleans that up as well. [1] https://docs.puppet.com/puppet/4.9/about_agent.html [2] http://apt.puppetlabs.com/dists/trusty/main [3] http://yum.puppetlabs.com/el/7/products/x86_64/ Change-Id: I06b5cd87ee7816b0f929d5e64dc66a5cceca222a --- .../files/centos7-puppetlabs.repo | 1 - .../openstack_project/manifests/template.pp | 32 ------------------- .../templates/00-puppet.pref.erb | 11 ------- 3 files changed, 44 deletions(-) delete mode 100644 modules/openstack_project/templates/00-puppet.pref.erb diff --git a/modules/openstack_project/files/centos7-puppetlabs.repo b/modules/openstack_project/files/centos7-puppetlabs.repo index c56e292509..66b4034a46 100644 --- a/modules/openstack_project/files/centos7-puppetlabs.repo +++ b/modules/openstack_project/files/centos7-puppetlabs.repo @@ -4,4 +4,3 @@ baseurl=http://yum.puppetlabs.com/el/7/products/$basearch gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs enabled=1 gpgcheck=1 -exclude=puppet-4* facter-3* puppetdb-3* puppetdb-terminus-3* diff --git a/modules/openstack_project/manifests/template.pp b/modules/openstack_project/manifests/template.pp index d4b49ad676..fad3209e29 100644 --- a/modules/openstack_project/manifests/template.pp +++ b/modules/openstack_project/manifests/template.pp @@ -221,26 +221,6 @@ class openstack_project::template ( line => ' UseRoaming no', } - ########################################################### - # Manage Puppet - # possible TODO: break this into openstack_project::puppet - - case $pin_puppet { - '2.7.': { - $pin_facter = '1.' - $pin_puppetdb = '1.' - } - /^3\./: { - $pin_facter = '2.' - $pin_puppetdb = '2.' - } - default: { - fail("Puppet version not supported") - } - } - - # Which Puppet do I take? - # Take $puppet_version and pin to that version if ($::osfamily == 'Debian') { # NOTE(pabelanger): Puppetlabs only support Ubuntu Trusty and below, # anything greater will use the OS version of puppet. @@ -280,15 +260,6 @@ class openstack_project::template ( replace => true, } - file { '/etc/apt/preferences.d/00-puppet.pref': - ensure => present, - owner => 'root', - group => 'root', - mode => '0444', - content => template('openstack_project/00-puppet.pref.erb'), - replace => true, - } - file { '/etc/default/puppet': ensure => present, owner => 'root', @@ -310,9 +281,6 @@ class openstack_project::template ( replace => true, } } - - $puppet_version = $pin_puppet - service { 'puppet': ensure => stopped, enable => false, diff --git a/modules/openstack_project/templates/00-puppet.pref.erb b/modules/openstack_project/templates/00-puppet.pref.erb deleted file mode 100644 index 759c84f45f..0000000000 --- a/modules/openstack_project/templates/00-puppet.pref.erb +++ /dev/null @@ -1,11 +0,0 @@ -Package: puppet puppet-common puppetmaster puppetmaster-common puppetmaster-passenger -Pin: version <%= @pin_puppet %>* -Pin-Priority: 501 - -Package: puppetdb puppetdb-terminus -Pin: version <%= @pin_puppetdb %>* -Pin-Priority: 501 - -Package: facter -Pin: version <%= @pin_facter %>* -Pin-Priority: 501