(GH-1055) Fix hardcoded cache path gh-1055-hardcoded_cache_path
authorCraig Gumbley <craiggumbley@gmail.com>
Mon, 22 Aug 2022 10:23:56 +0000 (10:23 +0000)
committerCraig Gumbley <craiggumbley@gmail.com>
Mon, 22 Aug 2022 19:09:25 +0000 (19:09 +0000)
commit58265f32854aaaa03d1abb83c1511563a2879e0b
treec04acce3ff794a9d8888434b30c93cbeb8e93c78
parent5ce72ec21187bd7d2ccf8a54710c4ef56585ef87
(GH-1055) Fix hardcoded cache path

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`.
manifests/ppa.pp
spec/defines/ppa_spec.rb