Bug 1317800 - fixes in shared scriptworker module. r=aki draft
authorMihai Tabara <mtabara@mozilla.com>
Wed, 04 Jan 2017 00:54:37 +0200
changeset 4595 5aa60c21e65fe099817ac86537d1c9ee1cae37a7
parent 4594 5f0d82f7b4450a8e31c83afe0b513e767c46f271
push id2535
push userbmo:mtabara@mozilla.com
push dateTue, 03 Jan 2017 22:55:17 +0000
reviewersaki
bugs1317800
Bug 1317800 - fixes in shared scriptworker module. r=aki MozReview-Commit-ID: 5Y7l9jP24pZ
modules/scriptworker/manifests/instance.pp
--- a/modules/scriptworker/manifests/instance.pp
+++ b/modules/scriptworker/manifests/instance.pp
@@ -18,19 +18,20 @@ define scriptworker::instance(
 
     # some constants
     $git_key_repo_dir = "${basedir}/gpg_key_repo/"
     $git_pubkey_dir = "${basedir}/git_pubkeys/"
 
     # This git repo has the various worker pubkeys
     git::repo {
         "scriptworker-${git_key_repo_dir}":
-            repo    => "${scriptworker::instance::settings::gpg_repo_url}",
+            repo    => "${scriptworker::instance::settings::git_key_repo_url}",
             dst_dir => $git_key_repo_dir,
-            user    => "${user}";
+            user    => "${username}",
+            require => Python35::Virtualenv["${basedir}"];
     }
 
     nrpe::custom {
         "scriptworker.cfg":
             content => template("scriptworker/nagios.cfg.erb");
     }
 
     file {
@@ -55,17 +56,18 @@ define scriptworker::instance(
         "${git_pubkey_dir}":
             ensure      => directory,
             mode        => 700,
             owner       => "${username}",
             group       => "${group}",
             source      => 'puppet:///modules/scriptworker/git_pubkeys',
             recurse     => true,
             recurselimit => 1,
-            purge       => true;
+            purge       => true,
+            require     => Python35::Virtualenv["${basedir}"];
         # cron jobs to poll git + rebuild gpg homedirs
         "/etc/cron.d/scriptworker":
             content     => template("scriptworker/scriptworker.cron.erb");
         # Notify rebuild_gpg_homedirs if the pubkey dir changes
         "${basedir}/.git-pubkey-dir-checksum":
             owner       => "${username}",
             group       => "${group}",
             notify  => Exec['rebuild_gpg_homedirs'];
@@ -102,13 +104,14 @@ define scriptworker::instance(
             require => [Python35::Virtualenv["${basedir}"],
                         Git::Repo["scriptworker-${git_key_repo_dir}"],
                         File["${basedir}/scriptworker.yaml"]],
             command => "${basedir}/bin/rebuild_gpg_homedirs ${basedir}/scriptworker.yaml",
             subscribe => File["${git_pubkey_dir}"],
             user    => "${username}";
         # Create checksum file of git pubkeys
         "${basedir}/.git-pubkey-dir-checksum":
-            path    => "/usr/local/bin/:/bin:/usr/sbin",
+            require => File["${git_pubkey_dir}"],
+            path    => "/usr/local/bin/:/bin:/usr/sbin:/usr/bin",
             user    => "${username}",
             command => "find ${git_pubkey_dir} -type f | xargs md5sum | sort > ${basedir}/.git-pubkey-dir-checksum";
     }
 }