Faidon Liambotis has uploaded a new change for review.

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

Change subject: snapshot: create a proper role::snapshot
......................................................................

snapshot: create a proper role::snapshot

Rather than including the "role" snapshot::common from site.pp and then
including directly the classes snapshot and snapshot::dumps, create a
proper role class "role::snapshot" which is included from the snapshot*
hosts.

While at it, remove all system::role references from the snapshot
module.

Change-Id: Idc907a518ff21db6ba0f7714191c3643d85c6998
---
R hieradata/role/common/snapshot.yaml
M manifests/role/snapshot.pp
M manifests/site.pp
M modules/snapshot/manifests/addschanges.pp
M modules/snapshot/manifests/centralauthdump.pp
M modules/snapshot/manifests/dumps.pp
M modules/snapshot/manifests/dumps/dumplists.pp
M modules/snapshot/manifests/dumps/mediadirlists.pp
M modules/snapshot/manifests/dumps/pagetitles.pp
M modules/snapshot/manifests/mediaperprojectlists.pp
M modules/snapshot/manifests/wikidatadumps.pp
11 files changed, 13 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/28/246828/1

diff --git a/hieradata/role/common/snapshot/common.yaml 
b/hieradata/role/common/snapshot.yaml
similarity index 100%
rename from hieradata/role/common/snapshot/common.yaml
rename to hieradata/role/common/snapshot.yaml
diff --git a/manifests/role/snapshot.pp b/manifests/role/snapshot.pp
index 6d15a58..418af8a 100644
--- a/manifests/role/snapshot.pp
+++ b/manifests/role/snapshot.pp
@@ -8,6 +8,17 @@
     }
 }
 
+class role::snapshot {
+    include role::snapshot::common
+
+    include ::snapshot
+    include ::snapshot::dumps
+
+    system::role { 'role::snapshot':
+        description => 'producer of XML dumps',
+    }
+}
+
 class role::snapshot::cron::primary {
     include role::snapshot::common
 
diff --git a/manifests/site.pp b/manifests/site.pp
index b04a353..a254142 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2471,11 +2471,9 @@
     # NOTE: New snapshot hosts must also be manually added
     # to modules/dataset/files/exports. One must also manually
     # run `exportfs -r` on dataset1001. (T111586)
-    role snapshot::common
-    include snapshot
-    include snapshot::dumps
+    role snapshot
     if $::fqdn == 'snapshot1003.eqiad.wmnet' {
-        include role::snapshot::cron::primary
+        role  snapshot::cron::primary
     }
 }
 
diff --git a/modules/snapshot/manifests/addschanges.pp 
b/modules/snapshot/manifests/addschanges.pp
index a9c1d26..9ba2100 100644
--- a/modules/snapshot/manifests/addschanges.pp
+++ b/modules/snapshot/manifests/addschanges.pp
@@ -18,11 +18,6 @@
         enable => $enable,
     }
 
-    system::role { 'snapshot::addschanges':
-        ensure      => $ensure,
-        description => 'producer of adds-changes dumps'
-    }
-
     cron { 'adds-changes':
         ensure      => $ensure,
         environment => '[email protected]',
diff --git a/modules/snapshot/manifests/centralauthdump.pp 
b/modules/snapshot/manifests/centralauthdump.pp
index b930a67..364f3ca 100644
--- a/modules/snapshot/manifests/centralauthdump.pp
+++ b/modules/snapshot/manifests/centralauthdump.pp
@@ -11,11 +11,6 @@
         $ensure = 'absent'
     }
 
-    system::role { 'snapshot::centralauthdump':
-        ensure      => $ensure,
-        description => 'mysql dumper of centralauth',
-    }
-
     file { '/usr/local/bin/dumpcentralauth.sh':
         mode   => '0755',
         owner  => 'root',
diff --git a/modules/snapshot/manifests/dumps.pp 
b/modules/snapshot/manifests/dumps.pp
index b8aa64e..fb099af 100644
--- a/modules/snapshot/manifests/dumps.pp
+++ b/modules/snapshot/manifests/dumps.pp
@@ -10,19 +10,6 @@
         $ensure = 'absent'
     }
 
-    if ($hugewikis) {
-        system::role { 'snapshot::dumps':
-            ensure      => $ensure,
-            description => 'producer of xml dumps for enwiki'
-        }
-    }
-    else {
-        system::role { 'snapshot::dumps':
-            ensure      => $ensure,
-            description => 'producer of xml dumps for all wikis but enwiki'
-        }
-    }
-
     class { 'snapshot::dumps::configs':
         enable           => $enable,
         hugewikis_enable => $hugewikis,
diff --git a/modules/snapshot/manifests/dumps/dumplists.pp 
b/modules/snapshot/manifests/dumps/dumplists.pp
index 6ff342d..f47a542 100644
--- a/modules/snapshot/manifests/dumps/dumplists.pp
+++ b/modules/snapshot/manifests/dumps/dumplists.pp
@@ -11,11 +11,6 @@
         $ensure = 'absent'
     }
 
-    system::role { 'snapshot::dumps::dumplists':
-        ensure      => $ensure,
-        description => 'producer of daily lists of good dumps for mirrors'
-    }
-
     file { '/usr/local/bin/list-last-good-dumps.sh':
         ensure  => 'present',
         path    => '/usr/local/bin/list-last-good-dumps.sh',
diff --git a/modules/snapshot/manifests/dumps/mediadirlists.pp 
b/modules/snapshot/manifests/dumps/mediadirlists.pp
index c526ee1..2b92a8e 100644
--- a/modules/snapshot/manifests/dumps/mediadirlists.pp
+++ b/modules/snapshot/manifests/dumps/mediadirlists.pp
@@ -11,11 +11,6 @@
         $ensure = 'absent'
     }
 
-    system::role { 'snapshot::dumps::mediadirlists':
-        ensure      => $ensure,
-        description => 'producer of daily lists of media directories'
-    }
-
     file { '/usr/local/bin/create-mediadir-list.sh':
         ensure  => 'present',
         path    => '/usr/local/bin/create-mediadir-list.sh',
diff --git a/modules/snapshot/manifests/dumps/pagetitles.pp 
b/modules/snapshot/manifests/dumps/pagetitles.pp
index 62a7629..e52514d 100644
--- a/modules/snapshot/manifests/dumps/pagetitles.pp
+++ b/modules/snapshot/manifests/dumps/pagetitles.pp
@@ -11,11 +11,6 @@
         $ensure = 'absent'
     }
 
-    system::role { 'snapshot::dumps::pagetitles':
-        ensure      => $ensure,
-        description => 'producer of daily page title files'
-    }
-
     file { "${snapshot::dirs::datadir}/public/other/pagetitles":
         ensure => 'directory',
         path   => "${snapshot::dirs::datadir}/public/other/pagetitles",
diff --git a/modules/snapshot/manifests/mediaperprojectlists.pp 
b/modules/snapshot/manifests/mediaperprojectlists.pp
index 0d7b8b5..5a6ffc5 100644
--- a/modules/snapshot/manifests/mediaperprojectlists.pp
+++ b/modules/snapshot/manifests/mediaperprojectlists.pp
@@ -11,11 +11,6 @@
         $ensure = 'absent'
     }
 
-    system::role { 'snapshot::mediaperprojectlists':
-        ensure      => $ensure,
-        description => 'producer of weekly lists of media per project'
-    }
-
     file { '/usr/local/bin/create-media-per-project-lists.sh':
         ensure  => 'present',
         path    => '/usr/local/bin/create-media-per-project-lists.sh',
diff --git a/modules/snapshot/manifests/wikidatadumps.pp 
b/modules/snapshot/manifests/wikidatadumps.pp
index 6972ba5..787bff7 100644
--- a/modules/snapshot/manifests/wikidatadumps.pp
+++ b/modules/snapshot/manifests/wikidatadumps.pp
@@ -37,11 +37,6 @@
         $ensure = 'absent'
     }
 
-    system::role { 'snapshot::wikidatadumps::json':
-        ensure      => $ensure,
-        description => 'producer of weekly wikidata json dumps'
-    }
-
     $scriptPath = '/usr/local/bin/dumpwikidatajson.sh'
     file { $scriptPath:
         mode    => '0755',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc907a518ff21db6ba0f7714191c3643d85c6998
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>

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

Reply via email to