Provide way to specify repo ref

We don't always want to use just 'master' since that may result in races
when running puppet across many nodes while project_config is changing.
Allow for a way to specify the ref we want via facter with a fallback to
master if the fact does not exist.

Change-Id: If1c17e55c7f1b15d28748761c3ee99af88fada40
This commit is contained in:
Clark Boylan 2015-02-09 16:21:20 -08:00
parent 4e30774cf4
commit 32bba65a8a
1 changed files with 9 additions and 1 deletions

View File

@ -22,11 +22,19 @@ class project_config(
$config_dir = Vcsrepo['/etc/project-config']
# Note project_config_ref is expected to be provided by facter
# if you want to use it.
if ($::project_config_ref != undef) {
$revision = $::project_config_ref
} else {
$revision = 'master'
}
if (!defined($config_dir)) {
vcsrepo { '/etc/project-config':
ensure => latest,
provider => git,
revision => 'master',
revision => $revision,
source => $url,
}
}