From 32bba65a8a14054388ce04c403e59b84a6cefad5 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 9 Feb 2015 16:21:20 -0800 Subject: [PATCH] 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 --- manifests/init.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 93c477e..b5d1c80 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, } }