Bug 1317800 - fixes in shared scriptworker module. r=aki
MozReview-Commit-ID: 5Y7l9jP24pZ
--- 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";
}
}