Ori.livneh has uploaded a new change for review.

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


Change subject: Add apache::mods::* to make Apache mods multiply-includable
......................................................................

Add apache::mods::* to make Apache mods multiply-includable

Use the same pattern we use for packages::* to allow Apache modules to be
included multiple times without causing duplicate definition errors.

Change-Id: I012f5e9bbee7764a9eae2a138611bebd828896ff
---
A puppet/modules/apache/manifests/mods.pp
M puppet/modules/mediawiki/manifests/apache.pp
M puppet/modules/php/manifests/init.pp
M puppet/modules/user_metrics/manifests/init.pp
4 files changed, 39 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/25/108225/1

diff --git a/puppet/modules/apache/manifests/mods.pp 
b/puppet/modules/apache/manifests/mods.pp
new file mode 100644
index 0000000..a99d390
--- /dev/null
+++ b/puppet/modules/apache/manifests/mods.pp
@@ -0,0 +1,32 @@
+# == Class: apache::mods
+#
+# This module contains unparametrized classes that wrap some popular
+# Apache mods. Because the classes are not parametrized, they may be
+# included multiple times without causing duplicate definition errors.
+#
+
+# mod_rewrite
+class apache::mods::rewrite {
+    apache::mod { 'rewrite': }
+}
+
+# mod_alias
+class apache::mods::alias {
+    apache::mod { 'alias': }
+}
+
+# mod_php5
+class apache::mods::php5 {
+    apache::mod { 'php5': }
+}
+
+# mod_wsgi
+class apache::mods::wsgi {
+    package { 'libapache2-mod-wsgi':
+        ensure => present,
+    }
+
+    apache::mod { 'wsgi':
+        require => Package['libapache2-mod-wsgi'],
+    }
+}
diff --git a/puppet/modules/mediawiki/manifests/apache.pp 
b/puppet/modules/mediawiki/manifests/apache.pp
index 5eb31cd..9da8779 100644
--- a/puppet/modules/mediawiki/manifests/apache.pp
+++ b/puppet/modules/mediawiki/manifests/apache.pp
@@ -5,6 +5,8 @@
 class mediawiki::apache {
     include ::mediawiki
     include ::apache
+    include ::apache::mods::alias
+    include ::apache::mods::rewrite
 
     apache::site { 'default':
         ensure => absent,
@@ -16,13 +18,6 @@
         require => [ Apache::Mod['alias'], Apache::Mod['rewrite'] ],
     }
 
-    apache::mod { 'alias':
-        ensure => present,
-    }
-
-    apache::mod { 'rewrite':
-        ensure => present,
-    }
 
     file { '/var/www/favicon.ico':
         ensure  => file,
diff --git a/puppet/modules/php/manifests/init.pp 
b/puppet/modules/php/manifests/init.pp
index ac980e3..45054b5 100644
--- a/puppet/modules/php/manifests/init.pp
+++ b/puppet/modules/php/manifests/init.pp
@@ -5,7 +5,8 @@
 # implemented.
 #
 class php {
-    include apache
+    include ::apache
+    include ::apache::mods::php5
 
     package { [
         'php5',
@@ -20,10 +21,6 @@
         'php5-mysql',
         'php5-xdebug'
     ]:
-        ensure => present,
-    }
-
-    apache::mod { 'php5':
         ensure => present,
     }
 
diff --git a/puppet/modules/user_metrics/manifests/init.pp 
b/puppet/modules/user_metrics/manifests/init.pp
index e841e0a..08c2077 100644
--- a/puppet/modules/user_metrics/manifests/init.pp
+++ b/puppet/modules/user_metrics/manifests/init.pp
@@ -45,7 +45,9 @@
         }
     }
 
-    include apache
+    include ::apache
+    include ::apache::mods::wsgi
+    include ::apache::mods::alias
 
     package { [ 'python-flask', 'python-flask-login', 'python-mysqldb', 
'python-numpy' ]:
         ensure => 'installed',
@@ -85,14 +87,6 @@
         command   => "mysql -f -pvagrant wiki < 
${user_metrics_path}/scripts/seed.sql;",
         unless    => 'mysql -pvagrant wiki -e "SELECT \'exists\' FROM page 
WHERE page_title = \'Hydriz\'" | grep -q exists',
         require   => [ Git::Clone['analytics/user-metrics'], Service['mysql'] ]
-    }
-
-    package { 'libapache2-mod-wsgi':
-        ensure => present,
-    }
-
-    apache::mod { 'wsgi':
-        require => Package['libapache2-mod-wsgi'],
     }
 
     apache::site { $site_name:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I012f5e9bbee7764a9eae2a138611bebd828896ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

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

Reply via email to