Skip to content

Commit

Permalink
provide proper default for $r10k_basedir
Browse files Browse the repository at this point in the history
The variable basically contains the value from the
puppet_environmentpath fact. The default is
/etc/puppetlabs/code/environments. We can safely fallback to the
default value if the fact is undef. This allows the module to work
properly during the first run.
  • Loading branch information
bastelfreak committed Jul 5, 2018
1 parent 0dfc213 commit f940e94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
$sources = undef
$puppet_master = true

$r10k_basedir = $facts['puppet_environmentpath']
if $facts['puppet_environmentpath'] {
$r10k_basedir = $facts['puppet_environmentpath']
} else {
$r10k_basedir = '/etc/puppetlabs/code/environments'
}
$r10k_cache_dir = "${facts['puppet_vardir']}/r10k"
$r10k_config_file = '/etc/puppetlabs/r10k/r10k.yaml'
$r10k_binary = 'r10k'
Expand Down

0 comments on commit f940e94

Please sign in to comment.