Andrew Bogott has uploaded a new change for review.

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


Change subject: Move run_directory into the actual base class.
......................................................................

Move run_directory into the actual base class.

This makes the load-order explicit and should ensure that it's
defined before we use it.

Change-Id: Id5eb567a433b083708571436b661e4b69f25d2f9
---
M manifests/mysql.pp
M modules/base/manifests/init.pp
2 files changed, 11 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/45/82845/1

diff --git a/manifests/mysql.pp b/manifests/mysql.pp
index 282268d..e92f8bc 100644
--- a/manifests/mysql.pp
+++ b/manifests/mysql.pp
@@ -631,22 +631,20 @@
        class { "generic::mysql::packages::client": version => $version }
        include generic::apparmor::service
 
-       # NOTE: $::run_directory is defined in base.pp
-
        # if $socket was not manually specified,
        # assume that the socket file should live in
        # $::run_directory/mysqld/mysqld.sock, otherwise
        # just use the path that was given.
        $socket_path = $socket ? {
-               false   => "$::run_directory/mysqld/mysqld.sock",
+               false   => "$base::run_directory/mysqld/mysqld.sock",
                default => $socket,
        }
        # if $pid_file was not manually specified,
        # assume that the pid file should live in
-       # $::run_directory/mysqld/mysqld.sock, otherwise
+       # $base::run_directory/mysqld/mysqld.sock, otherwise
        # just use the path that was given.
        $pid_path = $pid_file ? {
-               false   => "$::run_directory/mysqld/mysqld.pid",
+               false   => "$base::run_directory/mysqld/mysqld.pid",
                default => $pid_file,
        }
 
diff --git a/modules/base/manifests/init.pp b/modules/base/manifests/init.pp
index 6d2ed23..88ab257 100644
--- a/modules/base/manifests/init.pp
+++ b/modules/base/manifests/init.pp
@@ -1,11 +1,3 @@
-# /var/run has moved to /run in newer Ubuntu versions.
-# See: http://lwn.net/Articles/436012/
-if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '11.10') >= 0 {
-    $run_directory = '/run'
-} else {
-    $run_directory = '/var/run'
-}
-
 
 class base::access::dc-techs {
     # add account and sudoers rules for data center techs
@@ -382,6 +374,14 @@
             apt::noupgrade
     }
 
+    # /var/run has moved to /run in newer Ubuntu versions.
+    # See: http://lwn.net/Articles/436012/
+    if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '11.10') >= 
0 {
+        $run_directory = '/run'
+    } else {
+        $run_directory = '/var/run'
+    }
+
     include base::tcptweaks
 
     class { base::puppet:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5eb567a433b083708571436b661e4b69f25d2f9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to