Thcipriani has uploaded a new change for review.

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

Change subject: Add hiera yaml for staging, refactor salt class
......................................................................

Add hiera yaml for staging, refactor salt class

Adds a bunch of hiera variables for staging, and refactors the salt master
roles to allow for easier hiera abstraction.

Bug: T88304
Change-Id: I4265ed0b2c26e3ae29f10df7482386bfd7f5e559
---
A hieradata/labs/staging/common.yaml
M manifests/role/salt.pp
M modules/salt/manifests/master.pp
3 files changed, 22 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/45/193545/1

diff --git a/hieradata/labs/staging/common.yaml 
b/hieradata/labs/staging/common.yaml
new file mode 100644
index 0000000..52a9ef9
--- /dev/null
+++ b/hieradata/labs/staging/common.yaml
@@ -0,0 +1,8 @@
+---
+salt::master::salt_runner_dirs: [ '/srv/runners' ]
+salt::master::salt_peer_run: { '.*.eqiad.wmflabs': [ 'deploy.*' ] }
+salt::master::salt_state_roots: { base: [ '/srv/salt' ] }
+salt::master::salt_file_roots: { base: [ '/srv/salt' ] }
+salt::master::salt_pillar_roots: { base: [ '/srv/pillars' ] }
+salt::master::salt_module_roots: { base: [ '/srv/salt/_modules' ] }
+salt::master::salt_returner_roots: { base: [ '/srv/salt/_returners' ] }
diff --git a/manifests/role/salt.pp b/manifests/role/salt.pp
index 7b848a9..4b06c90 100644
--- a/manifests/role/salt.pp
+++ b/manifests/role/salt.pp
@@ -14,12 +14,7 @@
         salt_file_roots     => $salt_file_roots,
         salt_pillar_roots   => $salt_pillar_roots,
         salt_worker_threads => '25',
-    }
-
-    salt::master_environment{ 'base':
         salt_state_roots    => $salt_state_roots,
-        salt_file_roots     => $salt_file_roots,
-        salt_pillar_roots   => $salt_pillar_roots,
         salt_module_roots   => $salt_module_roots,
         salt_returner_roots => $salt_returner_roots,
     }
@@ -40,18 +35,13 @@
         salt_file_roots     => $salt_file_roots,
         salt_pillar_roots   => $salt_pillar_roots,
         salt_worker_threads => '50',
+        salt_state_roots    => $salt_state_roots,
+        salt_module_roots   => $salt_module_roots,
+        salt_returner_roots => $salt_returner_roots,
     }
 
     class { 'salt::reactors':
         salt_reactor_options => { 'puppet_server' => 'virt1000.wikimedia.org' 
},
-    }
-
-    salt::master_environment{ 'base':
-        salt_state_roots    => $salt_state_roots,
-        salt_file_roots     => $salt_file_roots,
-        salt_pillar_roots   => $salt_pillar_roots,
-        salt_module_roots   => $salt_module_roots,
-        salt_returner_roots => $salt_returner_roots,
     }
 
 }
@@ -76,12 +66,7 @@
         salt_file_roots     => $salt_file_roots,
         salt_pillar_roots   => $salt_pillar_roots,
         salt_worker_threads => '10',
-    }
-
-    salt::master_environment{ 'base':
         salt_state_roots    => $salt_state_roots,
-        salt_file_roots     => $salt_file_roots,
-        salt_pillar_roots   => $salt_pillar_roots,
         salt_module_roots   => $salt_module_roots,
         salt_returner_roots => $salt_returner_roots,
     }
diff --git a/modules/salt/manifests/master.pp b/modules/salt/manifests/master.pp
index 6267607..cd1d37b 100644
--- a/modules/salt/manifests/master.pp
+++ b/modules/salt/manifests/master.pp
@@ -11,6 +11,9 @@
     $salt_peer={},
     $salt_peer_run={},
     $salt_nodegroups={},
+    $salt_state_roots={'base'=>['/srv/salt']},
+    $salt_module_roots={'base'=>['/srv/salt/_modules']},
+    $salt_returner_roots={'base'=>['/srv/salt/_returners']},
 ){
     package { 'salt-master':
         ensure => $salt_version,
@@ -44,4 +47,12 @@
         owner  => 'root',
         group  => 'root',
     }
+
+    salt::master_environment{ 'base':
+        salt_state_roots    => $salt_state_roots,
+        salt_file_roots     => $salt_file_roots,
+        salt_pillar_roots   => $salt_pillar_roots,
+        salt_module_roots   => $salt_module_roots,
+        salt_returner_roots => $salt_returner_roots,
+    }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4265ed0b2c26e3ae29f10df7482386bfd7f5e559
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Thcipriani <tcipri...@wikimedia.org>

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

Reply via email to