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:
parent
4e30774cf4
commit
32bba65a8a
|
@ -22,11 +22,19 @@ class project_config(
|
||||||
|
|
||||||
$config_dir = Vcsrepo['/etc/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)) {
|
if (!defined($config_dir)) {
|
||||||
vcsrepo { '/etc/project-config':
|
vcsrepo { '/etc/project-config':
|
||||||
ensure => latest,
|
ensure => latest,
|
||||||
provider => git,
|
provider => git,
|
||||||
revision => 'master',
|
revision => $revision,
|
||||||
source => $url,
|
source => $url,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue