Merge "Allow specifying repo ref as a class parameter"
This commit is contained in:
commit
0ae88c3203
|
@ -17,24 +17,25 @@
|
||||||
|
|
||||||
class project_config(
|
class project_config(
|
||||||
$url,
|
$url,
|
||||||
|
$revision = 'master',
|
||||||
$base = undef,
|
$base = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$config_dir = Vcsrepo['/etc/project-config']
|
$config_dir = Vcsrepo['/etc/project-config']
|
||||||
|
|
||||||
# Note project_config_ref is expected to be provided by facter
|
# Note project_config_ref can be provided by facter if you want to use it.
|
||||||
# if you want to use it.
|
|
||||||
if ($::project_config_ref != undef) {
|
if ($::project_config_ref != undef) {
|
||||||
$revision = $::project_config_ref
|
$_revision = $::project_config_ref
|
||||||
} else {
|
}
|
||||||
$revision = 'master'
|
else {
|
||||||
|
$_revision = $revision
|
||||||
}
|
}
|
||||||
|
|
||||||
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 => $revision,
|
revision => $_revision,
|
||||||
source => $url,
|
source => $url,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue