Ema has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/270263

Change subject: Fix multiple definition of /var/lib/puppet
......................................................................

Fix multiple definition of /var/lib/puppet

We introduced a definition of File[/var/lib/puppet] in
https://gerrit.wikimedia.org/r/#/c/268684/.

However, File[/var/lib/puppet] was already defined in puppetmaster::ssl.

This patch introduces a new class called base::puppet::common which is
then included by base::puppet as well as puppetmaster::ssl to fix the
issue.

Change-Id: Ia6f17457bccf33bb7b155c619bfc08f990899f71
---
M modules/base/manifests/puppet.pp
M modules/puppetmaster/manifests/ssl.pp
2 files changed, 14 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/63/270263/1

diff --git a/modules/base/manifests/puppet.pp b/modules/base/manifests/puppet.pp
index 0458c4e..cf0b4b9 100644
--- a/modules/base/manifests/puppet.pp
+++ b/modules/base/manifests/puppet.pp
@@ -90,14 +90,7 @@
         source => 'puppet:///modules/base/logrotate/puppet',
     }
 
-    # Mode 0751 to make sure non-root users can access
-    # /var/lib/puppet/state/agent_disabled.lock to check if puppet is enabled
-    file { '/var/lib/puppet':
-        ensure => directory,
-        owner  => 'puppet',
-        group  => 'puppet',
-        mode   => '0751',
-    }
+    include base::puppet::common
 
     file { '/usr/local/bin/puppet-enabled':
         mode   => '0555',
@@ -112,3 +105,14 @@
         source   => 'puppet:///modules/base/puppet/97-last-puppet-run',
     }
 }
+
+class base::puppet::common {
+    # Mode 0751 to make sure non-root users can access
+    # /var/lib/puppet/state/agent_disabled.lock to check if puppet is enabled
+    file { '/var/lib/puppet':
+        ensure => directory,
+        owner  => 'puppet',
+        group  => 'puppet',
+        mode   => '0751',
+    }
+}
diff --git a/modules/puppetmaster/manifests/ssl.pp 
b/modules/puppetmaster/manifests/ssl.pp
index ea9086f..de2ee88 100644
--- a/modules/puppetmaster/manifests/ssl.pp
+++ b/modules/puppetmaster/manifests/ssl.pp
@@ -14,6 +14,8 @@
         $before = undef
     }
 
+    include base::puppet::common
+
     # Move the puppetmaster's SSL files to a separate directory from the client
     file {
         [ '/var/lib/puppet/server',
@@ -25,7 +27,6 @@
             mode    => '0771',
             before  => $before;
         [
-            '/var/lib/puppet',
             "${ssldir}/ca",
             "${ssldir}/certificate_requests",
             "${ssldir}/certs",

-- 
To view, visit https://gerrit.wikimedia.org/r/270263
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6f17457bccf33bb7b155c619bfc08f990899f71
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ema <e...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to