Asher has submitted this change and it was merged.

Change subject: initial redisdb role config patch set 2: ganglia config 
Change-Id: I819c79ba048fc14538db06a7aff956a9ca7f6460
......................................................................


initial redisdb role config
patch set 2: ganglia config
Change-Id: I819c79ba048fc14538db06a7aff956a9ca7f6460
---
M manifests/ganglia.pp
A manifests/role/redisdb.pp
M manifests/site.pp
M modules/redis/templates/redis.conf.erb
4 files changed, 43 insertions(+), 2 deletions(-)

Approvals:
  Asher: Verified; Looks good to me, approved



diff --git a/manifests/ganglia.pp b/manifests/ganglia.pp
index ac8b652..cf82867 100644
--- a/manifests/ganglia.pp
+++ b/manifests/ganglia.pp
@@ -148,6 +148,9 @@
                "parsoidcache"          => {
                        "name"          => "Parsoid Varnish",
                        "ip_oct"        => "38" },
+               "redis"                 => {
+                       "name"          => "Redis",
+                       "ip_oct"        => "39" },
        }
        # NOTE: Do *not* add new clusters *per site* anymore,
        # the site name will automatically be appended now,
diff --git a/manifests/role/redisdb.pp b/manifests/role/redisdb.pp
new file mode 100644
index 0000000..d83cde6
--- /dev/null
+++ b/manifests/role/redisdb.pp
@@ -0,0 +1,26 @@
+# role/redis.pp
+# db::redis
+
+# Virtual resource for the monitoring server
+@monitor_group { "redis_eqiad": description => "eqiad Redis" }
+@monitor_group { "redis_pmtpa": description => "pmtpa Redis" }
+
+class role::db::redis (
+       $maxmemory = inline_template("<%= (Float(memorysize.split[0]) * 
0.82).round %>Gb"),
+       $redis_replication = undef,
+) {
+       $cluster = "redis"
+
+       system_role { "db::redis": description => "Redis server" }
+
+       include standard
+
+       class { "redis":
+               maxmemory => $maxmemory,
+               redis_replication => $redis_replication,
+       }
+
+       include redis::ganglia
+
+}
+
diff --git a/manifests/site.pp b/manifests/site.pp
index e7836ba..4dc3fc5 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1336,7 +1336,8 @@
                misc::blogs::wikimedia
 }
 
-node /mc(1[0-9]|[0-9])\.pmtpa\.wmnet/ {
+
+node /^mc(1[0-9]|[0-9])\.pmtpa\.wmnet/ {
        $cluster = "memcached"
        if $hostname =~ /^mc[12]$/ {
                $ganglia_aggregator = "true"
@@ -1386,7 +1387,7 @@
        include redis::ganglia
 }
 
-node /mc(10[01][0-9])\.eqiad\.wmnet/ {
+node /^mc(10[01][0-9])\.eqiad\.wmnet/ {
        $cluster = "memcached"
        if $hostname =~ /^mc100[12]$/ {
                $ganglia_aggregator = "true"
@@ -1434,6 +1435,15 @@
        include redis::ganglia
 }
 
+node /^rdb100[12]\.eqiad\.wmnet/ {
+       $ganglia_aggregator = "true"
+
+       $redis_replication = {
+               'rdb1002' => 'rdb1001'
+       }
+
+       class { role::db::redis : redis_replication => $redis_replication }
+}
 
 node "mchenry.wikimedia.org" {
        $gid = 500
diff --git a/modules/redis/templates/redis.conf.erb 
b/modules/redis/templates/redis.conf.erb
index 8530b5e..fddfa4a 100644
--- a/modules/redis/templates/redis.conf.erb
+++ b/modules/redis/templates/redis.conf.erb
@@ -146,6 +146,8 @@
 # slaveof <masterip> <masterport>
 <% if @redis_replication and redis_replication.has_key?('site') and 
redis_replication['site'] -%>
 slaveof <%= redis_replication[hostname] %>.<%= redis_replication['site'] %> 
<%= port %>
+<% elsif @redis_replication and redis_replication.has_key?(hostname) -%>
+slaveof <%= redis_replication[hostname] %> <%= port %>
 <% end -%>
 
 # If the master is password protected (using the "requirepass" configuration

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I819c79ba048fc14538db06a7aff956a9ca7f6460
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Asher <afeld...@wikimedia.org>
Gerrit-Reviewer: Asher <afeld...@wikimedia.org>

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

Reply via email to