Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/350398 )

Change subject: ores: Switch the redis database role to profile
......................................................................


ores: Switch the redis database role to profile

Move the functionality of the redis ORES role to a new corresponding
profile and then include it in the role.

* Amend the hiera lookups to adhere to our Puppet coding guidelines
* Amend the hieradata as well to conform to the above
* Add a note about data found in the private repo

Change-Id: I688f99b3a22b94517ec3f019ee476c5e3784e553
---
M hieradata/hosts/oresrdb1002.yaml
M hieradata/hosts/oresrdb2002.yaml
M hieradata/role/codfw/ores/redis.yaml
M hieradata/role/common/ores/redis.yaml
M hieradata/role/eqiad/ores/redis.yaml
A modules/profile/manifests/ores/redis.pp
M modules/role/manifests/ores/redis.pp
7 files changed, 29 insertions(+), 24 deletions(-)

Approvals:
  Alexandros Kosiaris: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/hieradata/hosts/oresrdb1002.yaml b/hieradata/hosts/oresrdb1002.yaml
index 110ef82..fd7b7ca 100644
--- a/hieradata/hosts/oresrdb1002.yaml
+++ b/hieradata/hosts/oresrdb1002.yaml
@@ -1 +1 @@
-ores::redis::slaveof: oresrdb1001
+profile::ores::redis::slaveof: oresrdb1001
diff --git a/hieradata/hosts/oresrdb2002.yaml b/hieradata/hosts/oresrdb2002.yaml
index 8dd0a9d..b2f4e61 100644
--- a/hieradata/hosts/oresrdb2002.yaml
+++ b/hieradata/hosts/oresrdb2002.yaml
@@ -1 +1 @@
-ores::redis::slaveof: oresrdb2001
+profile::ores::redis::slaveof: oresrdb2001
diff --git a/hieradata/role/codfw/ores/redis.yaml 
b/hieradata/role/codfw/ores/redis.yaml
index d81eef0..a61827c 100644
--- a/hieradata/role/codfw/ores/redis.yaml
+++ b/hieradata/role/codfw/ores/redis.yaml
@@ -1,4 +1,4 @@
-ores::redis::client_hosts:
+profile::ores::redis::client_hosts:
   - scb2001.codfw.wmnet
   - scb2002.codfw.wmnet
   - scb2003.codfw.wmnet
diff --git a/hieradata/role/common/ores/redis.yaml 
b/hieradata/role/common/ores/redis.yaml
index fa6eb73..cd7eba2 100644
--- a/hieradata/role/common/ores/redis.yaml
+++ b/hieradata/role/common/ores/redis.yaml
@@ -1,5 +1,6 @@
 ores::redis::queue_maxmemory: 1G
 ores::redis::cache_maxmemory: 6G
+#profile::ores::redis::password: actually in the private repo
 debdeploy::grains:
   debdeploy-oresrdb:
     value: standard
diff --git a/hieradata/role/eqiad/ores/redis.yaml 
b/hieradata/role/eqiad/ores/redis.yaml
index 1bc65bb..30d9265e 100644
--- a/hieradata/role/eqiad/ores/redis.yaml
+++ b/hieradata/role/eqiad/ores/redis.yaml
@@ -1,4 +1,4 @@
-ores::redis::client_hosts:
+profile::ores::redis::client_hosts:
   - scb1001.eqiad.wmnet
   - scb1002.eqiad.wmnet
   - scb1003.eqiad.wmnet
diff --git a/modules/profile/manifests/ores/redis.pp 
b/modules/profile/manifests/ores/redis.pp
new file mode 100644
index 0000000..8da21a2
--- /dev/null
+++ b/modules/profile/manifests/ores/redis.pp
@@ -0,0 +1,22 @@
+# Setting up ORES Redis database in a replicated way in order to facilitate
+# failover if required
+class profile::ores::redis(
+    $password = hiera('profile::ores::redis::password'),
+    $redis_clients = hiera('profile::ores::redis::client_hosts'),
+    $slaveof  = hiera('profile::ores::redis::slaveof', undef),
+){
+    include ::standard
+    include ::base::firewall
+
+    class { '::ores::redis':
+        password => $password,
+        slaveof  => $slaveof,
+    }
+
+    $redis_hosts_ferm = join($redis_clients, ' ')
+    ferm::service { 'ores_redis':
+        proto  => 'tcp',
+        port   => '(6379 6380)',
+        srange => "@resolve((${redis_hosts_ferm}))",
+    }
+}
diff --git a/modules/role/manifests/ores/redis.pp 
b/modules/role/manifests/ores/redis.pp
index 2d8b896..2f43b48 100644
--- a/modules/role/manifests/ores/redis.pp
+++ b/modules/role/manifests/ores/redis.pp
@@ -1,22 +1,4 @@
-# Setting up ORES Redis database in a replicated way in order to facilitate
-# failover if required
+# Setting up ORES Redis database
 class role::ores::redis {
-    include ::standard
-    include ::base::firewall
-
-    # NOTE: We make this lookup explicit to avoid configuring by mistake a
-    # passwordless ores (::ores::redis password parameter defaults to undef)
-    $password = hiera('ores::redis::password')
-    # We rely on hiera for the slaveof parameter
-    class { '::ores::redis':
-        password        => $password,
-    }
-
-    $redis_clients = hiera('ores::redis::client_hosts')
-    $redis_hosts_ferm = join($redis_clients, ' ')
-    ferm::service { 'ores_redis':
-        proto  => 'tcp',
-        port   => '(6379 6380)',
-        srange => "@resolve((${redis_hosts_ferm}))",
-    }
+    include ::profile::ores::redis
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I688f99b3a22b94517ec3f019ee476c5e3784e553
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to