Ori.livneh has submitted this change and it was merged.
Change subject: mediawiki: use apache module
......................................................................
mediawiki: use apache module
The MediaWiki module defines and manages its own apache service because it uses
apache service status as a way of detecting a server that has just been
newly provisioned or rebooted.
The way it is currently supposed to work is this:
* the Apache service is not started on boot; it depends on Puppet to start it.
* but Service['apache'] subscribes to Exec['mw-sync'], so mw-sync is run first.
* mw-sync only runs unless '/bin/ps -C apache2', so if Apache is already
running, it doesn't run.
The idea is that the first Puppet run syncs the server and starts Apache.
I say "supposed to work" above because the sync-common script which mw-sync
invokes is a symlink to a file in /srv/scap which is manually deployed via
Trebuchet. So a newly-provisioned server can't bootstrap itself anyhow.
I thought of fixing this comprehensively in a single commit, but it is too
risky. I think the right approach is to simply remove it for now. Keeping code
around that is known not to work is pernicious and misleading, and certainly
much worse than not having it at all.
Change-Id: I17344357a67527fe6f55eb3c9c9bda46de2cd201
---
M modules/mediawiki/manifests/sync.pp
M modules/mediawiki/manifests/web.pp
M modules/mediawiki/manifests/web/config.pp
M modules/snapshot/manifests/common.pp
D modules/snapshot/manifests/sync.pp
5 files changed, 13 insertions(+), 58 deletions(-)
Approvals:
Ori.livneh: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/mediawiki/manifests/sync.pp
b/modules/mediawiki/manifests/sync.pp
index 712e29c..38ba2b2 100644
--- a/modules/mediawiki/manifests/sync.pp
+++ b/modules/mediawiki/manifests/sync.pp
@@ -56,24 +56,4 @@
group => 'wikidev',
mode => '0644',
}
-
- exec { 'mw-sync':
- command => '/usr/local/bin/sync-common',
- require => File['/a/common'],
- user => 'root',
- group => 'root',
- refreshonly => true,
- timeout => 600,
- logoutput => 'on_failure',
- }
-
- exec { 'mw-sync-rebuild-cdbs':
- command => '/usr/local/bin/scap-rebuild-cdbs',
- subscribe => Exec['mw-sync'],
- user => 'mwdeploy',
- group => 'mwdeploy',
- refreshonly => true,
- timeout => 600,
- logoutput => 'on_failure',
- }
}
diff --git a/modules/mediawiki/manifests/web.pp
b/modules/mediawiki/manifests/web.pp
index f22e07a..929032a 100644
--- a/modules/mediawiki/manifests/web.pp
+++ b/modules/mediawiki/manifests/web.pp
@@ -8,19 +8,4 @@
file { '/usr/local/apache':
ensure => directory,
}
-
- service { 'apache':
- ensure => running,
- name => 'apache2',
- enable => false,
- subscribe => Exec['mw-sync'],
- require => File['/etc/cluster'],
- }
-
- # Sync the server when we see apache is not running
- exec { 'apache-trigger-mw-sync':
- command => '/bin/true',
- unless => '/bin/ps -C apache2',
- notify => Exec['mw-sync'],
- }
}
diff --git a/modules/mediawiki/manifests/web/config.pp
b/modules/mediawiki/manifests/web/config.pp
index 3c415de..bfaf35c 100644
--- a/modules/mediawiki/manifests/web/config.pp
+++ b/modules/mediawiki/manifests/web/config.pp
@@ -1,7 +1,6 @@
class mediawiki::web::config () {
tag 'mediawiki', 'mw-apache-config'
- # We can enhance this to depend on the amount of ram as well
$apache_server_limit = 256
if is_integer($::mediawiki::web::workers_limit) {
@@ -12,29 +11,31 @@
$max_req_workers = inline_template('<%= [( @mem_available /
@mem_per_worker ).to_i, @apache_server_limit.to_i].min %>')
}
-
+ include ::apache
file { '/etc/apache2/apache2.conf':
content => template('mediawiki/apache/apache2.conf.erb'),
owner => 'root',
group => 'root',
mode => '0444',
- before => Service['apache'],
+ before => Service['apache2'],
+ require => Package['apache2'],
}
file { '/etc/apache2/envvars':
- source => 'puppet:///modules/mediawiki/apache/envvars.appserver',
- owner => 'root',
- group => 'root',
- mode => '0444',
- before => Service['apache'],
+ source => 'puppet:///modules/mediawiki/apache/envvars.appserver',
+ owner => 'root',
+ group => 'root',
+ mode => '0444',
+ before => Service['apache2'],
+ require => Package['apache2'],
}
-
file { '/etc/apache2/wikimedia':
ensure => directory,
- recurse => true,
source => 'puppet:///modules/mediawiki/apache/config',
- before => File['/etc/apache2/apache2.conf'],
+ recurse => true,
+ before => Service['apache2'],
+ require => Package['apache2'],
}
}
diff --git a/modules/snapshot/manifests/common.pp
b/modules/snapshot/manifests/common.pp
index 0ad6908..5a33a40 100644
--- a/modules/snapshot/manifests/common.pp
+++ b/modules/snapshot/manifests/common.pp
@@ -1,7 +1,6 @@
class snapshot::common {
include standard
-
include nfs::data
include snapshot::packages
- include snapshot::sync
+ include mediawiki::sync
}
diff --git a/modules/snapshot/manifests/sync.pp
b/modules/snapshot/manifests/sync.pp
deleted file mode 100644
index e41242b..0000000
--- a/modules/snapshot/manifests/sync.pp
+++ /dev/null
@@ -1,10 +0,0 @@
-class snapshot::sync {
- require snapshot::packages
- include mediawiki::sync
-
- exec { 'snapshot-trigger-mw-sync':
- command => '/bin/true',
- notify => Exec['mw-sync'],
- unless => '/usr/bin/test -d /usr/local/apache/common-local',
- }
-}
--
To view, visit https://gerrit.wikimedia.org/r/145620
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I17344357a67527fe6f55eb3c9c9bda46de2cd201
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Pyoungmeister <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits