[Lsb-messages] /var/www/bzr/lsb/devel/puppet-lsb r94: Handle buildbot slave passwords.

Jeff Licquia licquia at linuxfoundation.org
Sun Jan 29 04:11:06 UTC 2012


------------------------------------------------------------
revno: 94
committer: Jeff Licquia <licquia at linuxfoundation.org>
branch nick: puppet-lsb
timestamp: Sat 2012-01-28 23:11:06 -0500
message:
  Handle buildbot slave passwords.
modified:
  modules/buildbot/manifests/slave.pp
-------------- next part --------------
=== modified file 'modules/buildbot/manifests/slave.pp'
--- a/modules/buildbot/manifests/slave.pp	2012-01-28 17:08:55 +0000
+++ b/modules/buildbot/manifests/slave.pp	2012-01-29 04:11:06 +0000
@@ -1,14 +1,19 @@
 class buildbot::slave inherits buildbot {
 
     # Here, we figure out what user and password to use to log into the
-    # master.  This differs per-architecture.
+    # master.  This differs per-architecture.  The buildbotpw module
+    # is pulled in from puppet-secret, and just contains Puppet variables
+    # containing passwords.
+
+    include buildbotpw
 
     $masteruser = $architecture ? {
         /^i386$/ => 'lfbuild-x86',
     }
 
-    # XXX: need to set up secrets Puppet modules.
-    $masterpw = 'invalid'
+    $masterpw = $architecture ? {
+        /^i386$/ => $buildbotpw::x86password,
+    }
 
     # Which SDKs should we use for released and beta builds?
 
@@ -70,6 +75,16 @@
         require => [ Exec["make-buildslave"], File["/opt/buildbot/lsb-slave"] ],
     }
 
+    exec { "set-slave-pw":
+        command => "sed 's/^passwd[[:space:]]*=.*$/passwd = \"$masterpw\"/' < /opt/buildbot/lsb-slave/buildbot.tac > /opt/buildbot/lsb-slave/buildbot.tac.new && rm /opt/buildbot/lsb-slave/buildbot.tac && mv /opt/buildbot/lsb-slave/buildbot.tac.new /opt/buildbot/lsb-slave/buildbot.tac",
+        cwd     => '/opt/buildbot',
+        path    => [ '/opt/buildbot/bin', '/bin', '/sbin', '/usr/bin',
+                     '/usr/sbin' ],
+        user    => 'buildbot',
+        requre  => Exec['make-slave'],
+        onlyif  => "[ $(grep -c inlid /opt/buildbot/lsb-slave/buildbot.tac) -eq 0 ]",
+    }
+
     file { "/usr/local/bin/reset-sdk":
         source => "puppet:///modules/buildbot/slavescripts/reset-sdk",
         mode   => 0755,



More information about the lsb-messages mailing list