Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: pybal: serve the virtualhost with pybal lb files with a 
dedicated vhost
......................................................................


pybal: serve the virtualhost with pybal lb files with a dedicated vhost

Change-Id: I030d8ccd9f77da50a2ba1509bbd953bdce1bcbc9
Signed-off-by: Giuseppe Lavagetto <[email protected]>
---
A manifests/role/pybal_config.pp
M manifests/site.pp
A modules/pybal/manifests/web.pp
A modules/pybal/templates/config-vhost.conf.erb
4 files changed, 66 insertions(+), 0 deletions(-)

Approvals:
  Giuseppe Lavagetto: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/pybal_config.pp b/manifests/role/pybal_config.pp
new file mode 100644
index 0000000..6ab2e98
--- /dev/null
+++ b/manifests/role/pybal_config.pp
@@ -0,0 +1,12 @@
+class role::pybal_config {
+    system::role { 'pybal_config': description => 'Pybal configuration HTTP 
host' }
+
+    class { '::pybal::web':
+        vhostnames => [
+                       'config-master.eqiad.wmnet',
+                       'config-master.codfw.wmnet',
+                       'config-master.esams.wmnet',
+                       'config-master.ulsfo.wmnet',
+                       ]
+    }
+}
diff --git a/manifests/site.pp b/manifests/site.pp
index 03650d8..c49f606 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2388,6 +2388,7 @@
     include role::deployment::salt_masters::production
     include role::access_new_install
     include role::puppetmaster::frontend
+    include role::pybal_config
 }
 
 node /pc100[1-3]\.eqiad\.wmnet/ {
diff --git a/modules/pybal/manifests/web.pp b/modules/pybal/manifests/web.pp
new file mode 100644
index 0000000..ca27b39
--- /dev/null
+++ b/modules/pybal/manifests/web.pp
@@ -0,0 +1,30 @@
+# == Class pybal::web
+#
+# Sets up the virtualhost and the other resources for serving the pybal 
configs.
+#
+# == Parameters
+#
+# [*chostname*]
+# The ServerAlias hostname to add to the virtual host.
+#
+
+class pybal::web ($ensure = 'present', $vhostnames = 
['pybal-config.eqiad.wmnet']) {
+
+    $is_24 = ubuntu_version('>= trusty')
+
+    apache::site { 'pybal-config':
+        ensure   => $ensure,
+        priority => 50,
+        content  => template('pybal/config-vhost.conf.erb'),
+        notify   => Service['apache2'],
+        require  => File['/srv/pybal-config'],
+    }
+
+    file { '/srv/pybal-config':
+        ensure => ensure_directory($ensure),
+        owner  => 'root',
+        group  => 'root',
+        mode   => '0755',
+    }
+
+}
diff --git a/modules/pybal/templates/config-vhost.conf.erb 
b/modules/pybal/templates/config-vhost.conf.erb
new file mode 100644
index 0000000..1c68e2f
--- /dev/null
+++ b/modules/pybal/templates/config-vhost.conf.erb
@@ -0,0 +1,23 @@
+<VirtualHost *:80>
+    ServerName pybal-config
+    ServerAlias <%= @vhostnames.join(' ') %>
+    
+    DocumentRoot /srv/pybal-config
+
+    <Directory "/srv/pybal-config">
+ <% if @is_24 -%>
+         Require all granted
+<% else -%>
+         Order allow,deny
+         Allow from all
+<% end -%>
+         Options +Indexes -Followsymlinks
+         AllowOverride None
+     </Directory>
+
+     CustomLog ${APACHE_LOG_DIR}/pybal-access.log combined
+     ErrorLog ${APACHE_LOG_DIR}/pybal-error.log
+</VirtualHost>
+
+
+<!-- The ssl virtual host will be added if needed -->

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I030d8ccd9f77da50a2ba1509bbd953bdce1bcbc9
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to