Herron has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/389478 )
Change subject: puppet: conditionally pin packages to appropriate repo for
puppet 4
......................................................................
puppet: conditionally pin packages to appropriate repo for puppet 4
When $puppet_major_version == 4 pin puppet* packages to the apt repository
containing puppet 4 packages for the OS release.
Bug: T179724
Change-Id: I3346daed950ccfb0467fb2446e1c08e33324181b
---
M modules/base/manifests/puppet.pp
A modules/base/manifests/puppet/puppet4.pp
2 files changed, 39 insertions(+), 1 deletion(-)
Approvals:
Herron: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/base/manifests/puppet.pp b/modules/base/manifests/puppet.pp
index 7a1900d..6de7008 100644
--- a/modules/base/manifests/puppet.pp
+++ b/modules/base/manifests/puppet.pp
@@ -4,7 +4,7 @@
$dns_alt_names=undef,
$environment=undef,
$puppet_major_version=undef,
- ) {
+) {
include ::passwords::puppet::database
include ::base::puppet::params
$interval = $base::puppet::params::interval
@@ -13,6 +13,11 @@
$use_srv_record = $base::puppet::params::use_srv_record
$ca_server = hiera('puppetmaster::ca_server', '')
+
+ if $puppet_major_version == 4 {
+ include base::puppet::puppet4
+ }
+
package { [ 'puppet', 'facter' ]:
ensure => present,
}
diff --git a/modules/base/manifests/puppet/puppet4.pp
b/modules/base/manifests/puppet/puppet4.pp
new file mode 100644
index 0000000..4280ae6
--- /dev/null
+++ b/modules/base/manifests/puppet/puppet4.pp
@@ -0,0 +1,33 @@
+# === Class base::puppet::puppet4
+#
+# Pins packages to the needed versions for puppet 4 and does any other needed
configuration
+#
+
+class base::puppet::puppet4 {
+ if os_version('debian == jessie') {
+ $pin_to = 'jessie-backports'
+ }
+ elsif os_version('debian > jessie') {
+ # Use the distro-provided package
+ $pin_to = $facts['lsbdistcodename']
+ }
+ else {
+ # no support on trusty or older distros either, at the moment
+ warning('Puppet4 is still not available for this distribution')
+ $pin_to = undef
+ }
+
+ if $pin_to {
+ $pin_release = "release a=${pin_to}"
+ apt::pin { 'puppet-all':
+ pin => $pin_release,
+ package => 'puppet*',
+ priority => '1001',
+ }
+ apt::pin { 'facter':
+ pin => $pin_release,
+ package => 'facter',
+ priority => '1001',
+ }
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/389478
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3346daed950ccfb0467fb2446e1c08e33324181b
Gerrit-PatchSet: 7
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Herron <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Herron <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits