Giuseppe Lavagetto has uploaded a new change for review.

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

Change subject: role::mediawiki::webserver: add conftool scripts
......................................................................

role::mediawiki::webserver: add conftool scripts

Change-Id: If46c78810becd922d45a5644dd3452e875e4ee81
---
M modules/conftool/manifests/scripts/service.pp
M modules/conftool/templates/depool-service.erb
M modules/conftool/templates/pool-service.erb
A modules/conftool/templates/restart-service.erb
M modules/role/manifests/mediawiki/webserver.pp
5 files changed, 22 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/37/315937/1

diff --git a/modules/conftool/manifests/scripts/service.pp 
b/modules/conftool/manifests/scripts/service.pp
index f411ed3..3e741fa 100644
--- a/modules/conftool/manifests/scripts/service.pp
+++ b/modules/conftool/manifests/scripts/service.pp
@@ -18,7 +18,7 @@
     require ::conftool::scripts
     $lvs_config = $lvs_services_config[$lvs_name]
 
-    $service = $lvs_config['service']
+    $service = $lvs_config['conftool']['service']
     $port = $lvs_config['port']
     $hostnames = $lvs_class_hosts[$lvs_config['class']]
     $lvs_ips = inline_template(
@@ -39,4 +39,12 @@
         content => template('conftool/depool-service.erb'),
     }
 
+    file { "/usr/local/bin/restart-${title}":
+        ensure  => present,
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0555',
+        content => template('conftool/restart-service.erb'),
+    }
+
 }
diff --git a/modules/conftool/templates/depool-service.erb 
b/modules/conftool/templates/depool-service.erb
index b7b609c..9e81e47 100755
--- a/modules/conftool/templates/depool-service.erb
+++ b/modules/conftool/templates/depool-service.erb
@@ -1,2 +1,2 @@
 #!/bin/sh
-/usr/local/bin/pooler-loop --depool --lvs-ips <%= @lvs_ips %> --pool-name <%= 
"#{@lvs_name}_#{@port}" %> service=<%= @title %>
+/usr/local/bin/pooler-loop --depool --lvs-ips <%= @lvs_ips %> --pool-name <%= 
"#{@lvs_name}_#{@port}" %> service=<%= @service %>
diff --git a/modules/conftool/templates/pool-service.erb 
b/modules/conftool/templates/pool-service.erb
index a8555d9..9b9d7ba 100755
--- a/modules/conftool/templates/pool-service.erb
+++ b/modules/conftool/templates/pool-service.erb
@@ -1,2 +1,2 @@
 #!/bin/sh
-/usr/local/bin/pooler-loop --pool --lvs-ips <%= @lvs_ips %> --pool-name <%= 
"#{@lvs_name}_#{@port}" %> service=<%= @title %>
+/usr/local/bin/pooler-loop --pool --lvs-ips <%= @lvs_ips %> --pool-name <%= 
"#{@lvs_name}_#{@port}" %> service=<%= @service %>
diff --git a/modules/conftool/templates/restart-service.erb 
b/modules/conftool/templates/restart-service.erb
new file mode 100755
index 0000000..1274868
--- /dev/null
+++ b/modules/conftool/templates/restart-service.erb
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -e
+/usr/local/bin/depool-<%= @title %>
+/usr/sbin/service '<%= @title %>' restart
+/usr/local/bin/pool-<%= @title %>
diff --git a/modules/role/manifests/mediawiki/webserver.pp 
b/modules/role/manifests/mediawiki/webserver.pp
index 732446d..bc270e2 100644
--- a/modules/role/manifests/mediawiki/webserver.pp
+++ b/modules/role/manifests/mediawiki/webserver.pp
@@ -19,7 +19,13 @@
             realserver_ips => $ips,
         }
 
+        # Conftool config
         include ::mediawiki::conftool
+        conftool::scripts::service { 'hhvm':
+            lvs_name            => $pool,
+            lvs_class_hosts     => $lvs::configuration::lvs_class_hosts,
+            lvs_services_config => $lvs::configuration::lvs_services
+        }
     }
 
     ferm::service { 'mediawiki-http':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If46c78810becd922d45a5644dd3452e875e4ee81
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <glavage...@wikimedia.org>

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

Reply via email to