Hashar has uploaded a new change for review.

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


Change subject: contint: move apache proxy configuration to module
......................................................................

contint: move apache proxy configuration to module

Continuous integration has two internal webservices (Jenkins and Zuul)
which are exposed publicly via an Apache proxy. This patch moves the
definitions under the contint module and factor out common code in a new
contint::proxy_common class.

We still lack a role class for now, so include the proxy classes at the
site.pp level.

Change-Id: Ia140f6ed7ab9dc12d41422f109750e4018211516
---
M manifests/misc/contint.pp
M manifests/site.pp
R modules/contint/files/apache/proxy_jenkins
R modules/contint/files/apache/proxy_zuul
A modules/contint/manifests/proxy_common.pp
A modules/contint/manifests/proxy_jenkins.pp
A modules/contint/manifests/proxy_zuul.pp
7 files changed, 42 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/25/53425/1

diff --git a/manifests/misc/contint.pp b/manifests/misc/contint.pp
index 68b5bf0..f760c34 100644
--- a/manifests/misc/contint.pp
+++ b/manifests/misc/contint.pp
@@ -115,25 +115,6 @@
                                recurse => "true";
                }
 
-               # run jenkins behind Apache and have pretty URLs / proxy port 80
-               # 
https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache
-               class {'webserver::php5': ssl => 'true'; }
-
-               apache_module { proxy: name => "proxy" }
-               apache_module { proxy_http: name => "proxy_http" }
-
-               file {
-                       "/etc/apache2/conf.d/jenkins_proxy":
-                               owner => "root",
-                               group => "root",
-                               mode => 0444,
-                               source => 
"puppet:///files/misc/jenkins/apache_proxy";
-                       "/etc/apache2/conf.d/zuul_proxy":
-                               owner => "root",
-                               group => "root",
-                               mode => 0444,
-                               source => "puppet:///files/zuul/apache_proxy";
-               }
        }
 
        # prevent users from accessing port 8080 directly (but still allow from 
localhost and own net)
diff --git a/manifests/site.pp b/manifests/site.pp
index 27854e5..a2e5b12 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -773,6 +773,8 @@
        include standard,
                nrpe,
                contint::website,
+               contint::proxy_jenkins,
+               contint::proxy_zuul,
                misc::contint::test,
                misc::contint::test::packages,
                misc::contint::test::jenkins,
diff --git a/files/misc/jenkins/apache_proxy 
b/modules/contint/files/apache/proxy_jenkins
similarity index 100%
rename from files/misc/jenkins/apache_proxy
rename to modules/contint/files/apache/proxy_jenkins
diff --git a/files/zuul/apache_proxy b/modules/contint/files/apache/proxy_zuul
similarity index 100%
rename from files/zuul/apache_proxy
rename to modules/contint/files/apache/proxy_zuul
diff --git a/modules/contint/manifests/proxy_common.pp 
b/modules/contint/manifests/proxy_common.pp
new file mode 100644
index 0000000..c69b367
--- /dev/null
+++ b/modules/contint/manifests/proxy_common.pp
@@ -0,0 +1,9 @@
+# Basic configuration of Apache as a proxy
+class contint::proxy_common {
+
+  class {'webserver::php5': ssl => true; }
+
+  apache_module { 'contint_mod_proxy': name => 'proxy' }
+  apache_module { 'contint_mod_proxy_http': name => 'proxy_http' }
+
+}
diff --git a/modules/contint/manifests/proxy_jenkins.pp 
b/modules/contint/manifests/proxy_jenkins.pp
new file mode 100644
index 0000000..6302d2d
--- /dev/null
+++ b/modules/contint/manifests/proxy_jenkins.pp
@@ -0,0 +1,17 @@
+# A http proxy in front of Jenkins
+class contint::proxy_jenkins {
+
+  include proxy_common
+
+  # run jenkins behind Apache and have pretty URLs / proxy port 80
+  # https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache
+
+  file {
+    '/etc/apache2/conf.d/jenkins_proxy':
+      owner  => 'root',
+      group  => 'root',
+      mode   => '0444',
+      source => 'puppet:///modules/contint/apache/proxy_jenkins',
+  }
+
+}
diff --git a/modules/contint/manifests/proxy_zuul.pp 
b/modules/contint/manifests/proxy_zuul.pp
new file mode 100644
index 0000000..2422d5f
--- /dev/null
+++ b/modules/contint/manifests/proxy_zuul.pp
@@ -0,0 +1,14 @@
+# A http proxy in front of Zuul status page
+class contint::proxy_zuul {
+
+  include proxy_common
+
+  file {
+    '/etc/apache2/conf.d/zuul_proxy':
+      owner  => 'root',
+      group  => 'root',
+      mode   => '0444',
+      source => 'puppet:///modules/contint/apache/proxy_zuul',
+  }
+
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia140f6ed7ab9dc12d41422f109750e4018211516
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <has...@free.fr>

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

Reply via email to