Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/96746
Change subject: applicationserver: retab
......................................................................
applicationserver: retab
No significant changes.
Change-Id: I586ef8c02fa5e3a81782958c79e7b2edaaf48a59
---
M modules/applicationserver/manifests/apache_packages.pp
M modules/applicationserver/manifests/config/apache.pp
M modules/applicationserver/manifests/config/base.pp
M modules/applicationserver/manifests/config/php.pp
M modules/applicationserver/manifests/cron.pp
M modules/applicationserver/manifests/init.pp
M modules/applicationserver/manifests/packages.pp
M modules/applicationserver/manifests/pybal_check.pp
M modules/applicationserver/manifests/service.pp
M modules/applicationserver/manifests/sudo.pp
M modules/applicationserver/manifests/syslog.pp
11 files changed, 198 insertions(+), 198 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/46/96746/1
diff --git a/modules/applicationserver/manifests/apache_packages.pp
b/modules/applicationserver/manifests/apache_packages.pp
index 69c4be8..406e451 100644
--- a/modules/applicationserver/manifests/apache_packages.pp
+++ b/modules/applicationserver/manifests/apache_packages.pp
@@ -1,7 +1,7 @@
class applicationserver::apache_packages {
- include applicationserver::packages
+ include applicationserver::packages
- package { 'libapache2-mod-php5':
- ensure => present,
- }
+ package { 'libapache2-mod-php5':
+ ensure => present,
+ }
}
diff --git a/modules/applicationserver/manifests/config/apache.pp
b/modules/applicationserver/manifests/config/apache.pp
index ce617e5..bb0b766 100644
--- a/modules/applicationserver/manifests/config/apache.pp
+++ b/modules/applicationserver/manifests/config/apache.pp
@@ -3,49 +3,49 @@
#
# requires applicationserver::packages to be in place
class applicationserver::config::apache(
- $maxclients="40"
- ) {
+ $maxclients="40"
+ ) {
- Class["applicationserver::apache_packages"] ->
Class["applicationserver::config::apache"]
+ Class["applicationserver::apache_packages"] ->
Class["applicationserver::config::apache"]
- file {
- "/etc/apache2/apache2.conf":
- owner => root,
- group => root,
- mode => 0444,
- content =>
template("applicationserver/apache/apache2.conf.erb");
- "/etc/apache2/envvars":
- owner => root,
- group => root,
- mode => 0444,
- source =>
"puppet:///modules/applicationserver/apache/envvars.appserver";
- "/etc/cluster":
- mode => 0444,
- owner => root,
- group => root,
- content => $::site;
- }
+ file {
+ "/etc/apache2/apache2.conf":
+ owner => root,
+ group => root,
+ mode => 0444,
+ content => template("applicationserver/apache/apache2.conf.erb");
+ "/etc/apache2/envvars":
+ owner => root,
+ group => root,
+ mode => 0444,
+ source =>
"puppet:///modules/applicationserver/apache/envvars.appserver";
+ "/etc/cluster":
+ mode => 0444,
+ owner => root,
+ group => root,
+ content => $::site;
+ }
- if $::realm == 'production' {
- file {
- '/usr/local/apache':
- ensure => directory,
- }
- exec { "sync apache wmf config":
- require => File["/usr/local/apache"],
- path => "/bin:/sbin:/usr/bin:/usr/sbin",
- command => "rsync -av 10.0.5.8::httpdconf/
/usr/local/apache/conf",
- creates => "/usr/local/apache/conf",
- notify => Service[apache]
- }
- } else { # labs
- # bug 38996 - Apache service does not run on start, need a fake
- # sync to start it up.
- exec { 'Fake sync apache wmf config on beta':
- command => '/bin/true',
- notify => Service[apache],
- }
- }
+ if $::realm == 'production' {
+ file {
+ '/usr/local/apache':
+ ensure => directory,
+ }
+ exec { "sync apache wmf config":
+ require => File["/usr/local/apache"],
+ path => "/bin:/sbin:/usr/bin:/usr/sbin",
+ command => "rsync -av 10.0.5.8::httpdconf/ /usr/local/apache/conf",
+ creates => "/usr/local/apache/conf",
+ notify => Service[apache]
+ }
+ } else { # labs
+ # bug 38996 - Apache service does not run on start, need a fake
+ # sync to start it up.
+ exec { 'Fake sync apache wmf config on beta':
+ command => '/bin/true',
+ notify => Service[apache],
+ }
+ }
- Class["applicationserver::config::apache"] ->
Class["applicationserver::config::base"]
+ Class["applicationserver::config::apache"] ->
Class["applicationserver::config::base"]
}
diff --git a/modules/applicationserver/manifests/config/base.pp
b/modules/applicationserver/manifests/config/base.pp
index 4ca321f..06b22f6 100644
--- a/modules/applicationserver/manifests/config/base.pp
+++ b/modules/applicationserver/manifests/config/base.pp
@@ -1,6 +1,6 @@
# applicationserver::config
class applicationserver::config::base {
- # Other classes can depend on this to ensure all configuration
- # is complete
+ # Other classes can depend on this to ensure all configuration
+ # is complete
}
\ No newline at end of file
diff --git a/modules/applicationserver/manifests/config/php.pp
b/modules/applicationserver/manifests/config/php.pp
index 991e917..5d22792 100644
--- a/modules/applicationserver/manifests/config/php.pp
+++ b/modules/applicationserver/manifests/config/php.pp
@@ -5,59 +5,59 @@
#
# requires applicationserver::packages to be in place
class applicationserver::config::php(
- $fatal_log_file='udp://10.64.0.21:8420'
+ $fatal_log_file='udp://10.64.0.21:8420'
) {
- Class["applicationserver::packages"] ->
Class["applicationserver::config::php"]
+ Class["applicationserver::packages"] ->
Class["applicationserver::config::php"]
- file {
- "/etc/php5/apache2/php.ini":
- owner => root,
- group => root,
- mode => 0444,
- source =>
"puppet:///modules/applicationserver/php/php.ini";
- "/etc/php5/cli/php.ini":
- owner => root,
- group => root,
- mode => 0444,
- source =>
"puppet:///modules/applicationserver/php/php.ini.cli";
- "/etc/php5/conf.d/fss.ini":
- owner => root,
- group => root,
- mode => 0444,
- source =>
"puppet:///modules/applicationserver/php/fss.ini";
- "/etc/php5/conf.d/apc.ini":
- owner => root,
- group => root,
- mode => 0444,
- source =>
"puppet:///modules/applicationserver/php/apc.ini";
- "/etc/php5/conf.d/wmerrors.ini":
- owner => root,
- group => root,
- mode => 0444,
- content =>
template("applicationserver/php/wmerrors.ini.erb");
- "/etc/php5/conf.d/igbinary.ini":
- owner => root,
- group => root,
- mode => 0444,
- source => "puppet:///files/php/igbinary.ini";
- "/etc/php5/conf.d/wikidiff2.ini":
- mode => 0444,
- owner => root,
- group => root,
- content => "
+ file {
+ "/etc/php5/apache2/php.ini":
+ owner => root,
+ group => root,
+ mode => 0444,
+ source => "puppet:///modules/applicationserver/php/php.ini";
+ "/etc/php5/cli/php.ini":
+ owner => root,
+ group => root,
+ mode => 0444,
+ source => "puppet:///modules/applicationserver/php/php.ini.cli";
+ "/etc/php5/conf.d/fss.ini":
+ owner => root,
+ group => root,
+ mode => 0444,
+ source => "puppet:///modules/applicationserver/php/fss.ini";
+ "/etc/php5/conf.d/apc.ini":
+ owner => root,
+ group => root,
+ mode => 0444,
+ source => "puppet:///modules/applicationserver/php/apc.ini";
+ "/etc/php5/conf.d/wmerrors.ini":
+ owner => root,
+ group => root,
+ mode => 0444,
+ content => template("applicationserver/php/wmerrors.ini.erb");
+ "/etc/php5/conf.d/igbinary.ini":
+ owner => root,
+ group => root,
+ mode => 0444,
+ source => "puppet:///files/php/igbinary.ini";
+ "/etc/php5/conf.d/wikidiff2.ini":
+ mode => 0444,
+ owner => root,
+ group => root,
+ content => "
; This file is managed by Puppet!
extension=wikidiff2.so
";
- "/etc/php5/conf.d/mail.ini":
- mode => 0444,
- owner => root,
- group => root,
- content => "
+ "/etc/php5/conf.d/mail.ini":
+ mode => 0444,
+ owner => root,
+ group => root,
+ content => "
// Force the envelope sender address to empty, since we don't want to receive
bounces
mail.force_extra_parameters=\"-f <>\"
";
- }
+ }
- Class["applicationserver::config::php"] ->
Class["applicationserver::config::base"]
+ Class["applicationserver::config::php"] ->
Class["applicationserver::config::base"]
}
diff --git a/modules/applicationserver/manifests/cron.pp
b/modules/applicationserver/manifests/cron.pp
index 978e000..c2af61e 100644
--- a/modules/applicationserver/manifests/cron.pp
+++ b/modules/applicationserver/manifests/cron.pp
@@ -1,16 +1,16 @@
# application server required cron jobs
class applicationserver::cron {
- cron {
- "cleanupipc":
- command => "ipcs -s | grep apache | cut -f 2 -d \\ |
xargs -rn 1 ipcrm -s",
- user => root,
- minute => 26,
- ensure => present;
- "cleantmpphp":
- command => "find /tmp -name 'php*' -type f -ctime +1
-exec rm -f {} \\;",
- user => root,
- hour => 5,
- minute => 0,
- ensure => present;
- }
+ cron {
+ "cleanupipc":
+ command => "ipcs -s | grep apache | cut -f 2 -d \\ | xargs -rn 1
ipcrm -s",
+ user => root,
+ minute => 26,
+ ensure => present;
+ "cleantmpphp":
+ command => "find /tmp -name 'php*' -type f -ctime +1 -exec rm -f
{} \\;",
+ user => root,
+ hour => 5,
+ minute => 0,
+ ensure => present;
+ }
}
\ No newline at end of file
diff --git a/modules/applicationserver/manifests/init.pp
b/modules/applicationserver/manifests/init.pp
index 325c6d7..a38e3e1 100644
--- a/modules/applicationserver/manifests/init.pp
+++ b/modules/applicationserver/manifests/init.pp
@@ -1,12 +1,12 @@
# application server base class
class applicationserver {
- case $::operatingsystem {
- debian, ubuntu: {
- }
- default: {
- fail("Module ${module_name} is not supported on
${::operatingsystem}")
- }
- }
+ case $::operatingsystem {
+ debian, ubuntu: {
+ }
+ default: {
+ fail("Module ${module_name} is not supported on
${::operatingsystem}")
+ }
+ }
- include apache_packages, service, cron, sudo, config::base
+ include apache_packages, service, cron, sudo, config::base
}
diff --git a/modules/applicationserver/manifests/packages.pp
b/modules/applicationserver/manifests/packages.pp
index b64315f..4d54431 100644
--- a/modules/applicationserver/manifests/packages.pp
+++ b/modules/applicationserver/manifests/packages.pp
@@ -1,23 +1,23 @@
# application server required packages
class applicationserver::packages {
- package { [ "php5-cli", "php-pear", "php5-common", "php5-curl",
"php5-mysql", "php5-xmlrpc",
- "php5", "php5-intl" ]:
- ensure => latest;
- }
- package { [ "php-wikidiff2", "php5-wmerrors", "php-luasandbox",
"php5-redis",
- "php5-memcached", "libmemcached11", "php5-igbinary" ]:
- ensure => latest;
- }
+ package { [ "php5-cli", "php-pear", "php5-common", "php5-curl",
"php5-mysql", "php5-xmlrpc",
+ "php5", "php5-intl" ]:
+ ensure => latest;
+ }
+ package { [ "php-wikidiff2", "php5-wmerrors", "php-luasandbox",
"php5-redis",
+ "php5-memcached", "libmemcached11", "php5-igbinary" ]:
+ ensure => latest;
+ }
package { [ "php-mail", "php-mail-mime" ]:
ensure => latest;
}
- if $::lsbdistid == "Ubuntu" and versioncmp($::lsbdistrelease, "12.04")
>= 0 {
- # On Precise, the 'php5' packages also provides the 'php5-fpm'
which
- # install an unneeded fast CGI server.
- package { [ "php5-fpm" ]:
- ensure => absent;
- }
- }
+ if $::lsbdistid == "Ubuntu" and versioncmp($::lsbdistrelease, "12.04") >=
0 {
+ # On Precise, the 'php5' packages also provides the 'php5-fpm' which
+ # install an unneeded fast CGI server.
+ package { [ "php5-fpm" ]:
+ ensure => absent;
+ }
+ }
}
diff --git a/modules/applicationserver/manifests/pybal_check.pp
b/modules/applicationserver/manifests/pybal_check.pp
index 082416e..c002fe3 100644
--- a/modules/applicationserver/manifests/pybal_check.pp
+++ b/modules/applicationserver/manifests/pybal_check.pp
@@ -1,21 +1,21 @@
# creates pybal-check system user
class applicationserver::pybal_check {
- $authorized_key = 'command="uptime; touch /var/tmp/pybal-check.stamp"
ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEAwyiL/ImTNOjoP/8k1UFQRM9pcspHp3yIsH/8TYXH/HJ1rQVjMleq6IQ6ZwAXhKfw/v1xV28SbkctB8pISZoR4rcCqOIN+osXkCB419JydCEb5abPS4mB5Gkn2bZAF43DGr5kaW+HYIsgtZ+QEC+nS4j3NA/Bjb7lAbHUtHVuC6BCOaZfGf+Q2FO4Z6xC7zc/1ngaDgvrXYzyCvXzTAQmcZH0d2/GoS1DQoLdLzqu66aZK1dmn9TAHV4a3R4gp7El7OzVHqDp1E6y0sopd+qKNAw/3GgXC91XJ3XO22h+ZnVovIpIS01CJ6GiBig/55Xrh//9Wuw5GFQuCptYbPQr4Q==
root@lvs4'
+ $authorized_key = 'command="uptime; touch /var/tmp/pybal-check.stamp"
ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEAwyiL/ImTNOjoP/8k1UFQRM9pcspHp3yIsH/8TYXH/HJ1rQVjMleq6IQ6ZwAXhKfw/v1xV28SbkctB8pISZoR4rcCqOIN+osXkCB419JydCEb5abPS4mB5Gkn2bZAF43DGr5kaW+HYIsgtZ+QEC+nS4j3NA/Bjb7lAbHUtHVuC6BCOaZfGf+Q2FO4Z6xC7zc/1ngaDgvrXYzyCvXzTAQmcZH0d2/GoS1DQoLdLzqu66aZK1dmn9TAHV4a3R4gp7El7OzVHqDp1E6y0sopd+qKNAw/3GgXC91XJ3XO22h+ZnVovIpIS01CJ6GiBig/55Xrh//9Wuw5GFQuCptYbPQr4Q==
root@lvs4'
- # Create pybal-check user account
- generic::systemuser { "pybal-check": name => "pybal-check", home =>
"/var/lib/pybal-check", shell => "/bin/sh" }
+ # Create pybal-check user account
+ generic::systemuser { "pybal-check": name => "pybal-check", home =>
"/var/lib/pybal-check", shell => "/bin/sh" }
- file {
- "/var/lib/pybal-check/.ssh":
- require => Generic::Systemuser["pybal-check"],
- owner => "pybal-check",
- group => "pybal-check",
- mode => 0550,
- ensure => directory;
- "/var/lib/pybal-check/.ssh/authorized_keys":
- owner => "pybal-check",
- group => "pybal-check",
- mode => 0440,
- content => $authorized_key;
- }
-}
\ No newline at end of file
+ file {
+ "/var/lib/pybal-check/.ssh":
+ require => Generic::Systemuser["pybal-check"],
+ owner => "pybal-check",
+ group => "pybal-check",
+ mode => 0550,
+ ensure => directory;
+ "/var/lib/pybal-check/.ssh/authorized_keys":
+ owner => "pybal-check",
+ group => "pybal-check",
+ mode => 0440,
+ content => $authorized_key;
+ }
+}
diff --git a/modules/applicationserver/manifests/service.pp
b/modules/applicationserver/manifests/service.pp
index 4c112e7..a4a1cf9 100644
--- a/modules/applicationserver/manifests/service.pp
+++ b/modules/applicationserver/manifests/service.pp
@@ -1,35 +1,35 @@
# applicationserver::service
class applicationserver::service {
- Class["applicationserver::apache_packages"] ->
Class["applicationserver::service"]
- Class["applicationserver::config::base"] ->
Class["applicationserver::service"]
- include mediawiki::sync
+ Class["applicationserver::apache_packages"] ->
Class["applicationserver::service"]
+ Class["applicationserver::config::base"] ->
Class["applicationserver::service"]
+ include mediawiki::sync
- # Start apache but not at boot
- service { 'apache':
- name => "apache2",
- enable => false,
- subscribe => Exec['mw-sync'],
- require => Exec['mw-sync'],
- ensure => running;
- }
+ # Start apache but not at boot
+ service { 'apache':
+ name => "apache2",
+ enable => false,
+ subscribe => Exec['mw-sync'],
+ require => Exec['mw-sync'],
+ ensure => running;
+ }
- # Sync the server when we see apache is not running
- exec { 'apache-trigger-mw-sync':
- command => '/bin/true',
- notify => Exec['mw-sync'],
- unless => "/bin/ps -C apache2 > /dev/null"
- }
+ # Sync the server when we see apache is not running
+ exec { 'apache-trigger-mw-sync':
+ command => '/bin/true',
+ notify => Exec['mw-sync'],
+ unless => "/bin/ps -C apache2 > /dev/null"
+ }
- # Has to be less than apache, and apache has to be nice 0 or less to be
- # blue in ganglia.
- if $::lsbdistid == "Ubuntu" and versioncmp($::lsbdistrelease, "12.04")
>= 0 {
- file { "/etc/init/ssh.override":
- owner => root,
- group => root,
- mode => 0444,
- content => "nice -10",
- ensure => present;
- }
- }
+ # Has to be less than apache, and apache has to be nice 0 or less to be
+ # blue in ganglia.
+ if $::lsbdistid == "Ubuntu" and versioncmp($::lsbdistrelease, "12.04") >=
0 {
+ file { "/etc/init/ssh.override":
+ owner => root,
+ group => root,
+ mode => 0444,
+ content => "nice -10",
+ ensure => present;
+ }
+ }
}
diff --git a/modules/applicationserver/manifests/sudo.pp
b/modules/applicationserver/manifests/sudo.pp
index 562882c..fc65e56 100644
--- a/modules/applicationserver/manifests/sudo.pp
+++ b/modules/applicationserver/manifests/sudo.pp
@@ -1,16 +1,16 @@
# application server sudo definitions
class applicationserver::sudo {
- require groups::wikidev
+ require groups::wikidev
- sudo_group {"wikidev_apache":
- privileges => ['ALL = (apache) NOPASSWD: ALL'],
- group => "wikidev"
- }
+ sudo_group {"wikidev_apache":
+ privileges => ['ALL = (apache) NOPASSWD: ALL'],
+ group => "wikidev"
+ }
- sudo_group {"wikidev_root":
- privileges => ['ALL= NOPASSWD: /usr/sbin/apache2ctl,
/etc/init.d/apache2, /usr/bin/renice, /usr/local/bin/find-nearest-rsync'],
- group => "wikidev"
- }
+ sudo_group {"wikidev_root":
+ privileges => ['ALL= NOPASSWD: /usr/sbin/apache2ctl,
/etc/init.d/apache2, /usr/bin/renice, /usr/local/bin/find-nearest-rsync'],
+ group => "wikidev"
+ }
}
diff --git a/modules/applicationserver/manifests/syslog.pp
b/modules/applicationserver/manifests/syslog.pp
index a64d1d6..3f029cc 100644
--- a/modules/applicationserver/manifests/syslog.pp
+++ b/modules/applicationserver/manifests/syslog.pp
@@ -1,20 +1,20 @@
# syslog instance and configuration for applicationservers
class applicationserver::syslog( $apache_log_aggregator ) {
- require base::remote-syslog
+ require base::remote-syslog
- file {
- "/etc/rsyslog.d/40-appserver.conf":
- require => Package[rsyslog],
- owner => root,
- group => root,
- mode => 0444,
- content => template("rsyslog/40-appserver.conf.erb"),
- ensure => present;
- "/usr/local/bin/apache-syslog-rotate":
- owner => root,
- group => root,
- mode => 0555,
- source =>
"puppet:///files/misc/scripts/apache-syslog-rotate",
- ensure => present;
- }
+ file {
+ "/etc/rsyslog.d/40-appserver.conf":
+ require => Package[rsyslog],
+ owner => root,
+ group => root,
+ mode => 0444,
+ content => template("rsyslog/40-appserver.conf.erb"),
+ ensure => present;
+ "/usr/local/bin/apache-syslog-rotate":
+ owner => root,
+ group => root,
+ mode => 0555,
+ source => "puppet:///files/misc/scripts/apache-syslog-rotate",
+ ensure => present;
+ }
}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/96746
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I586ef8c02fa5e3a81782958c79e7b2edaaf48a59
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits