Asher has uploaded a new change for review.

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


Change subject: initial redisdb role config
......................................................................

initial redisdb role config

Change-Id: I819c79ba048fc14538db06a7aff956a9ca7f6460
---
A manifests/role/redisdb.pp
M manifests/site.pp
M modules/redis/templates/redis.conf.erb
3 files changed, 38 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/00/53800/1

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..3a45044 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,13 @@
        include redis::ganglia
 }
 
+node /^rdb100[12]\.eqiad\.wmnet/ {
+       $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: newchange
Gerrit-Change-Id: I819c79ba048fc14538db06a7aff956a9ca7f6460
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Asher <[email protected]>

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

Reply via email to