20after4 has uploaded a new change for review.

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

Change subject: WIP: phabricator refactor init.pp
......................................................................

WIP: phabricator refactor init.pp

Moving stuff to apache.pp and phd.pp

Change-Id: Ibe4c44f5a3b0d2fa3cb85ade708d0782403e3e54
---
M modules/phabricator/files/apache/mpm_prefork.conf
A modules/phabricator/manifests/apache.pp
M modules/phabricator/manifests/init.pp
D modules/phabricator/manifests/mpm.pp
M modules/phabricator/manifests/phd.pp
5 files changed, 98 insertions(+), 80 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/08/324808/1

diff --git a/modules/phabricator/files/apache/mpm_prefork.conf 
b/modules/phabricator/files/apache/mpm_prefork.conf
index da875fa..99935d6 100644
--- a/modules/phabricator/files/apache/mpm_prefork.conf
+++ b/modules/phabricator/files/apache/mpm_prefork.conf
@@ -6,13 +6,12 @@
 # MaxConnectionsPerChild: maximum number of requests a server process serves
 
 <IfModule mpm_prefork_module>
-       StartServers            8
-       MinSpareServers         25
-       MaxSpareServers         50
-       MaxRequestWorkers       200
-        MaxClients             450
-        ServerLimit            450
-       MaxConnectionsPerChild  0
+       StartServers        15
+       MinSpareServers     5
+       MaxSpareServers     25
+       ServerLimit         320
+       MaxRequestWorkers   320          
+       MaxRequestsPerChild 300
 </IfModule>
 
 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
diff --git a/modules/phabricator/manifests/apache.pp 
b/modules/phabricator/manifests/apache.pp
new file mode 100644
index 0000000..931bba8
--- /dev/null
+++ b/modules/phabricator/manifests/apache.pp
@@ -0,0 +1,65 @@
+# == Class: phabricator::apache
+class phabricator::apache(
+    $base_requirements,
+    $settings,
+    $serveradmin,
+    $gitblit_servername,
+    $phab_servername,
+    $docroot,
+    $serveraliases,
+    $timezone,
+) {
+    $phabdir = $::phabricator::phabdir
+
+    include apache::mod::php5
+    include apache::mod::rewrite
+    include apache::mod::headers
+
+    # git.wikimedia.org hosts rewrite rules to redirect old gitblit urls to
+    # equivilent diffusion urls.
+    file { '/srv/git.wikimedia.org':
+        ensure => 'directory',
+        owner  => 'root',
+        group  => 'root',
+    }
+
+    apache::site { 'git.wikimedia.org':
+        content => template('phabricator/gitblit_vhost.conf.erb'),
+        require => File['/srv/git.wikimedia.org'],
+        notify  => Service['apache2'],
+    }
+    
+    apache::site { 'phabricator':
+        content => template('phabricator/phabricator-default.conf.erb'),
+        require => $base_requirements,
+        notify  => Service['apache2'],
+    }
+
+    apache::conf { 'mpm_prefork':
+        source => 'puppet:///modules/phabricator/apache/mpm_prefork.conf',
+        notify => Service['apache2'],
+    }
+
+    # Robots.txt disallowing to crawl the alias domain
+    if $serveraliases {
+        file {"${phabdir}/robots.txt":
+            ensure  => present,
+            owner   => 'root',
+            group   => 'root',
+            mode    => '0444',
+            content => "User-agent: *\nDisallow: /\n",
+        }
+    }
+
+    file { '/etc/php5/apache2/php.ini':
+        content => template('phabricator/php.ini.erb'),
+        notify  => Service['apache2'],
+        require => Package['libapache2-mod-php5'],
+    }
+
+    file { '/etc/apache2/phabbanlist.conf':
+        source  => 'puppet:///modules/phabricator/apache/phabbanlist.conf',
+        require => Package['libapache2-mod-php5'],
+        notify  => Service['apache2'],
+    }
+}
diff --git a/modules/phabricator/manifests/init.pp 
b/modules/phabricator/manifests/init.pp
index 3b0e6e3..52fb1c7 100644
--- a/modules/phabricator/manifests/init.pp
+++ b/modules/phabricator/manifests/init.pp
@@ -110,46 +110,6 @@
             ensure => present;
     }
 
-    include apache::mod::php5
-    include apache::mod::rewrite
-    include apache::mod::headers
-
-    $docroot = "${phabdir}/phabricator/webroot"
-
-    $phab_servername = hiera('phabricator_servername', 
$phab_settings['phabricator.base-uri'])
-
-    apache::site { 'phabricator':
-        content => template('phabricator/phabricator-default.conf.erb'),
-        require => $base_requirements,
-    }
-
-    # git.wikimedia.org hosts rewrite rules to redirect old gitblit urls to
-    # equivilent diffusion urls.
-
-    $gitblit_servername = $phab_settings['gitblit.hostname']
-
-    file { '/srv/git.wikimedia.org':
-        ensure => 'directory',
-        owner  => 'root',
-        group  => 'root',
-    }
-
-    apache::site { 'git.wikimedia.org':
-        content => template('phabricator/gitblit_vhost.conf.erb'),
-        require => File['/srv/git.wikimedia.org'],
-    }
-
-    # Robots.txt disallowing to crawl the alias domain
-    if $serveraliases {
-        file {"${phabdir}/robots.txt":
-            ensure  => present,
-            owner   => 'root',
-            group   => 'root',
-            mode    => '0444',
-            content => "User-agent: *\nDisallow: /\n",
-        }
-    }
-
     scap::target { $deploy_target:
         deploy_user => $deploy_user,
         key_name    => 'phabricator',
@@ -186,18 +146,6 @@
         $phab_settings['load-libraries'] = $libraries
     }
 
-    file { '/etc/php5/apache2/php.ini':
-        content => template('phabricator/php.ini.erb'),
-        notify  => Service['apache2'],
-        require => Package['libapache2-mod-php5'],
-    }
-
-    file { '/etc/apache2/phabbanlist.conf':
-        source  => 'puppet:///modules/phabricator/apache/phabbanlist.conf',
-        require => Package['libapache2-mod-php5'],
-        notify  => Service['apache2'],
-    }
-
     file { "${phabdir}/phabricator/conf/local/local.json":
         content => template('phabricator/local.json.erb'),
         require => $base_requirements,
@@ -210,7 +158,7 @@
         create_resources(phabricator::conf_env, $conf_files)
     }
 
-    #default location for phabricator tracked repositories
+    # default location for phabricator tracked repositories
     if ($phab_settings['repository.default-local-path']) {
         $repo_root = $phab_settings['repository.default-local-path']
         file { $repo_root:
@@ -235,6 +183,22 @@
         require => $base_requirements,
     }
 
+    $docroot = "${phabdir}/phabricator/webroot"
+    $phab_servername = hiera('phabricator_servername', 
$phab_settings['phabricator.base-uri'])
+    $gitblit_servername = $settings['gitblit.hostname']
+
+    class { 'phabriccator::apache':
+        base_requirements  => $base_requirements,
+        settings           => $phab_settings,
+        serveradmin        => $serveradmin,
+        gitblit_servername => $gitblit_servername,
+        phab_servername    => $phab_servername,
+        docroot            => $docroot,
+        serveraliases      => $serveraliases,
+        timezone           => $timezone,
+    }
+
+
     class { 'phabricator::vcs':
         basedir  => $phabdir,
         settings => $phab_settings,
@@ -246,16 +210,6 @@
         settings => $phab_settings,
         before   => Service['phd'],
         require  => $base_requirements,
-    }
-
-    if $::initsystem == 'systemd' {
-        file { '/etc/systemd/system/phd.service':
-            ensure => present,
-            owner  => 'root',
-            group  => 'root',
-            mode   => '0444',
-            source => 'puppet:///modules/phabricator/systemd/phd.service',
-        }
     }
 
     # phd service is only running on active server set in Hiera
diff --git a/modules/phabricator/manifests/mpm.pp 
b/modules/phabricator/manifests/mpm.pp
deleted file mode 100644
index f71c74a..0000000
--- a/modules/phabricator/manifests/mpm.pp
+++ /dev/null
@@ -1,10 +0,0 @@
-# == Class: phabricator::mpm
-#
-# MPM tweaks for high load systems
-# More performance specific tweaks to follow here
-
-class phabricator::mpm {
-    apache::conf { 'mpm_prefork':
-        source => 'puppet:///modules/phabricator/apache/mpm_prefork.conf',
-    }
-}
diff --git a/modules/phabricator/manifests/phd.pp 
b/modules/phabricator/manifests/phd.pp
index 703c63e..7d4914f 100644
--- a/modules/phabricator/manifests/phd.pp
+++ b/modules/phabricator/manifests/phd.pp
@@ -58,4 +58,14 @@
         ensure => present,
         source => 'puppet:///modules/phabricator/logrotate_phd',
     }
+
+    if $::initsystem == 'systemd' {
+        file { '/etc/systemd/system/phd.service':
+            ensure => present,
+            owner  => 'root',
+            group  => 'root',
+            mode   => '0444',
+            source => 'puppet:///modules/phabricator/systemd/phd.service',
+        }
+    }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe4c44f5a3b0d2fa3cb85ade708d0782403e3e54
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: 20after4 <mmod...@wikimedia.org>

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

Reply via email to