Prior to this commit the cache path used to create the script file resource
was hardcoded to /opt/puppetlabs/puppet/cache.
This commit fixes that by using the `puppet_vardir` fact provided by stdlib so
that we will always get the correct path for the OS that is executing the code.
Additionally, if for some reason the `puppet_vardir` fact is not available we
will fall back to `tmp`.
$trusted_gpg_d_filename = "${dash_filename_no_specialchars}.gpg"
}
$trusted_gpg_d_filename = "${dash_filename_no_specialchars}.gpg"
}
- # This is the location of our main exec script
- $script_path = "/opt/puppetlabs/puppet/cache/add-apt-repository-${dash_filename_no_specialchars}-${release}.sh"
+ # This is the location of our main exec script.
+ $cache_path = $facts['puppet_vardir']
+ $script_path = "${cache_path}/add-apt-repository-${dash_filename_no_specialchars}-${release}.sh"
if $ensure == 'present' {
if $package_manage {
if $ensure == 'present' {
if $package_manage {
+ puppet_vardir: '/opt/puppetlabs/puppet/cache'
+ puppet_vardir: '/opt/puppetlabs/puppet/cache',
+ puppet_vardir: '/opt/puppetlabs/puppet/cache',
+ puppet_vardir: '/opt/puppetlabs/puppet/cache',
+ puppet_vardir: '/opt/puppetlabs/puppet/cache',
+ puppet_vardir: '/opt/puppetlabs/puppet/cache',
+ puppet_vardir: '/opt/puppetlabs/puppet/cache',
+ puppet_vardir: '/opt/puppetlabs/puppet/cache',
+ puppet_vardir: '/opt/puppetlabs/puppet/cache',