diff --git a/manifests/eyaml.pp b/manifests/eyaml.pp index dedc65c..7a7f501 100644 --- a/manifests/eyaml.pp +++ b/manifests/eyaml.pp @@ -33,7 +33,7 @@ exec { 'createkeys': user => $owner, cwd => $confdir, - command => "${cmdpath}/eyaml createkeys", + command => 'eyaml createkeys', path => $cmdpath, creates => "${confdir}/keys/private_key.pkcs7.pem", require => Package['hiera-eyaml'], diff --git a/manifests/init.pp b/manifests/init.pp index 9cb9797..7aa6cbd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -59,6 +59,11 @@ # Note: You need to manage any package/gem dependancies # Default: native # +# [*cmdpath*] +# Search paths for command binaries, like the 'eyaml' command. +# The default should cover most cases. +# Default: ['/opt/puppet/bin', '/usr/bin', '/usr/local/bin'] +# # === Actions: # # Installs either /etc/puppet/hiera.yaml or /etc/puppetlabs/puppet/hiera.yaml. @@ -104,6 +109,7 @@ $eyaml_extension = $hiera::params::eyaml_extension, $confdir = $hiera::params::confdir, $logger = $hiera::params::logger, + $cmdpath = $hiera::params::cmdpath, $merge_behavior = undef, $extra_config = '', ) inherits hiera::params { diff --git a/manifests/params.pp b/manifests/params.pp index f6bea61..354c93e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -20,7 +20,6 @@ $owner = 'pe-puppet' $group = 'pe-puppet' $provider = 'pe_gem' - $cmdpath = '/opt/puppet/bin' $confdir = '/etc/puppetlabs/puppet' } else { $hiera_yaml = '/etc/puppet/hiera.yaml' @@ -28,9 +27,9 @@ $owner = 'puppet' $group = 'puppet' $provider = 'gem' - $cmdpath = '/usr/bin/puppet' $confdir = '/etc/puppet' } + $cmdpath = ['/opt/puppet/bin', '/usr/bin', '/usr/local/bin'] $datadir_manage = true $backends = ['yaml'] $logger = 'console'