From 22a82b03bdecc3f4be382a05fa08758250bacf10 Mon Sep 17 00:00:00 2001
From: Adam Henry Lewenberg <adamhl@stanford.edu>
Date: Wed, 17 Jan 2018 14:11:03 -0800
Subject: [PATCH] puppet-backend alternative stuff

---
 manifests/os/debian.pp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/manifests/os/debian.pp b/manifests/os/debian.pp
index 6554c0a..1d8fa83 100644
--- a/manifests/os/debian.pp
+++ b/manifests/os/debian.pp
@@ -84,6 +84,23 @@ class base::os::debian (
     'stanford-server': ensure => present;
   }
 
+  # This next stanza uses the PuppetForge module puppet/alternatives to
+  # set the correct puppet-backend script.
+  case $facts['os']['distro']['codename'] {
+    'wheezy', 'jessie': {
+      alternatives { 'puppet-backend':
+        path => '/usr/sbin/puppet-backend3',
+        require => Package['stanford-server'],
+      }
+    }
+    default: {
+      alternatives { 'puppet-backend':
+        path => '/usr/sbin/puppet-backend5',
+        require => Package['stanford-server'],
+      }
+    }
+  }
+
   # libstdc++5 and smbios-utils are required for Dell firmware updates, so
   # install them on physical machines.
   if $::virtual == 'vmware' {
-- 
GitLab