jenkins-bot has submitted this change and it was merged.

Change subject: Lint
......................................................................


Lint

- Rely on autorequire when possible.
- Don't specify paths when not necessary.
- Use apache2ctl -M to detect presence of apache2 mods.

Change-Id: I8fdab69508c367ec692f0123f2b1bba381a0cbe9
---
M puppet/manifests/site.pp
M puppet/modules/apache/manifests/init.pp
M puppet/modules/apache/manifests/mod.pp
M puppet/modules/apache/manifests/site.pp
M puppet/modules/mysql/manifests/init.pp
5 files changed, 20 insertions(+), 26 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp
index dc3175d..ef67080 100644
--- a/puppet/manifests/site.pp
+++ b/puppet/manifests/site.pp
@@ -30,7 +30,7 @@
        ensure => present,
 }
 
-class { 'memcached': }
 class { 'misc': }
 class { 'git': }
+class { 'memcached': }
 class { 'mediawiki': }
diff --git a/puppet/modules/apache/manifests/init.pp 
b/puppet/modules/apache/manifests/init.pp
index 26d00c5..29b6a3d 100644
--- a/puppet/modules/apache/manifests/init.pp
+++ b/puppet/modules/apache/manifests/init.pp
@@ -1,21 +1,18 @@
-# Apache web server with mod_php
 class apache {
-
        package { ['apache2', 'libapache2-mod-php5']:
                ensure  => present,
        }
 
        file { '/etc/apache2/conf.d/disable-sendfile':
-               ensure  => file,
-               source  => 'puppet:///modules/apache/disable-sendfile',
-               require => Package['apache2'],
-               before  => Service['apache2'],
+               ensure => file,
+               source => 'puppet:///modules/apache/disable-sendfile',
+               notify => Package['apache2'],
        }
 
        service { 'apache2':
                ensure     => running,
                provider   => 'init',
-               require    => Package['apache2', 'libapache2-mod-php5'],
+               require    => Package['apache2'],
                hasrestart => true,
        }
 }
diff --git a/puppet/modules/apache/manifests/mod.pp 
b/puppet/modules/apache/manifests/mod.pp
index 0eba6a1..7c12a1e 100644
--- a/puppet/modules/apache/manifests/mod.pp
+++ b/puppet/modules/apache/manifests/mod.pp
@@ -7,15 +7,15 @@
 
        case $ensure {
                present: {
-                       exec { "/usr/sbin/a2enmod ${mod}":
-                               unless  => "test -f 
/etc/apache2/mods-enabled/${mod}.load",
+                       exec { "a2enmod ${mod}":
+                               unless  => "apache2ctl -M | grep -q ${mod}",
                                require => Package['apache2'],
                                notify  => Service['apache2'],
                        }
                }
                absent: {
-                       exec { "/usr/sbin/a2dismod ${mod}":
-                               onlyif  => "test -f 
/etc/apache2/mods-enabled/${mod}.load",
+                       exec { "a2dismod ${mod}":
+                               onlyif  => "apache2ctl -M | grep -q ${mod}",
                                require => Package['apache2'],
                                notify  => Service['apache2'],
                        }
diff --git a/puppet/modules/apache/manifests/site.pp 
b/puppet/modules/apache/manifests/site.pp
index 42469bc..13bf90d 100644
--- a/puppet/modules/apache/manifests/site.pp
+++ b/puppet/modules/apache/manifests/site.pp
@@ -14,20 +14,22 @@
                                        ensure  => file,
                                        content => $content,
                                        require => Package['apache2'],
-                                       before  => Exec["/usr/sbin/a2ensite -qf 
${site}"],
+                                       before  => Exec["enable ${site}"],
                                }
                        }
-                       exec { "/usr/sbin/a2ensite -qf ${site}":
-                               require => Package['apache2'],
+                       exec { "enable ${title}":
+                               command => "a2ensite -qf ${site}",
                                notify  => Service['apache2'],
-                               unless  => "a2dissite <<<'' | head -1 | cut -c 
19- | grep -w ${site}"
+                               require => Package['apache2'],
+                               unless  => "a2dissite <<<'' | head -1 | cut -c 
19- | grep -w ${site}",
                        }
                }
                absent: {
-                       exec { "/usr/sbin/a2dissite -qf ${site}":
-                               require => Package['apache2'],
+                       exec { "disable ${title}":
+                               command => "a2dissite -qf ${site}",
                                notify  => Service['apache2'],
-                               onlyif  => "a2dissite <<<'' | head -1 | cut -c 
19- | grep -w ${site}"
+                               require => Package['apache2'],
+                               onlyif  => "a2dissite <<<'' | head -1 | cut -c 
19- | grep -w ${site}",
                        }
                }
        }
diff --git a/puppet/modules/mysql/manifests/init.pp 
b/puppet/modules/mysql/manifests/init.pp
index 00347ba..d95e5e4 100644
--- a/puppet/modules/mysql/manifests/init.pp
+++ b/puppet/modules/mysql/manifests/init.pp
@@ -1,4 +1,3 @@
-# MySQL class. Provisions ~/.my.cnf for convinience.
 class mysql(
        $password = 'vagrant',
        $dbname   = undef
@@ -15,12 +14,10 @@
        }
 
        exec { 'set-mysql-password':
-               unless  => "mysqladmin -u root -p\"${password}\" status",
                command => "mysqladmin -u root password \"${password}\"",
+               unless  => "mysqladmin -u root -p\"${password}\" status",
+               require => Service['mysql'],
        }
-
-       Package['mysql-server'] -> Service['mysql']
-       Service['mysql'] -> Exec['set-mysql-password']
 
        file { '/home/vagrant/.my.cnf':
                ensure  => file,
@@ -30,6 +27,4 @@
                replace => no,
                content => template('mysql/my.cnf.erb'),
        }
-
-
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8fdab69508c367ec692f0123f2b1bba381a0cbe9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to