Dzahn has submitted this change and it was merged.

Change subject: use ensure_resource to avoid duplicate declarations
......................................................................


use ensure_resource to avoid duplicate declarations

These roles should work independently but also when combined on
the same node. Without this you either get a puppet fail because
/srv/deployment is missing or a fail because it is a duplicate
declaration in both places.

ensure_resource from stdlib only creates a resource if it doesn't
already exist

Change-Id: I7f89cc6ed43eb6cf7798134691b301ba6383732a
---
M modules/iegreview/manifests/init.pp
M modules/wikimania_scholarships/manifests/init.pp
2 files changed, 6 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/iegreview/manifests/init.pp 
b/modules/iegreview/manifests/init.pp
index b0aeea8..7b84824 100644
--- a/modules/iegreview/manifests/init.pp
+++ b/modules/iegreview/manifests/init.pp
@@ -73,7 +73,9 @@
         content => template('iegreview/apache.conf.erb'),
     }
 
-    file { [ '/srv/deployment', '/srv/deployment/iegreview', $deploy_dir ]:
+    ensure_resource('file', '/srv/deployment', {'ensure' => 'directory' })
+
+    file { [ '/srv/deployment/iegreview', $deploy_dir ]:
         ensure => directory,
     }
 
diff --git a/modules/wikimania_scholarships/manifests/init.pp 
b/modules/wikimania_scholarships/manifests/init.pp
index 82581a8..fff2998 100644
--- a/modules/wikimania_scholarships/manifests/init.pp
+++ b/modules/wikimania_scholarships/manifests/init.pp
@@ -50,7 +50,9 @@
         content => template('wikimania_scholarships/apache.conf.erb'),
     }
 
-    file { [ '/srv/deployment', '/srv/deployment/scholarships', $deploy_dir ]:
+    ensure_resource('file', '/srv/deployment', {'ensure' => 'directory' })
+
+    file { [ '/srv/deployment/scholarships', $deploy_dir ]:
         ensure  => directory,
     }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f89cc6ed43eb6cf7798134691b301ba6383732a
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to