]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge pull request #1056 from puppetlabs/gh-1055-hardcoded_cache_path
authorLukas Audzevicius <97180854+LukasAud@users.noreply.github.com>
Wed, 31 Aug 2022 10:27:52 +0000 (11:27 +0100)
committerGitHub <noreply@github.com>
Wed, 31 Aug 2022 10:27:52 +0000 (11:27 +0100)
(GH-1055) Fix hardcoded cache path

manifests/ppa.pp
spec/defines/ppa_spec.rb

index e3c53e8e6d6f5226962da2507e4ce41dc97e0ff3..f6cba8d38abff2d597797b7ac98f9627f9d5def0 100644 (file)
@@ -67,8 +67,9 @@ define apt::ppa (
     $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 {
index c056b5ba3df24bf30b8b2ba751df2ea910b2eb1f..74265cde99bbc5376ec31962f70d42cf862e3bb5 100644 (file)
@@ -30,6 +30,7 @@ describe 'apt::ppa' do
             id: 'Ubuntu',
           },
         },
+        puppet_vardir: '/opt/puppetlabs/puppet/cache'
       }
     end
 
@@ -58,6 +59,7 @@ describe 'apt::ppa' do
             id: 'Ubuntu',
           },
         },
+        puppet_vardir: '/opt/puppetlabs/puppet/cache',
       }
     end
 
@@ -96,6 +98,7 @@ describe 'apt::ppa' do
             id: 'Ubuntu',
           },
         },
+        puppet_vardir: '/opt/puppetlabs/puppet/cache',
       }
     end
 
@@ -128,6 +131,7 @@ describe 'apt::ppa' do
             id: 'Ubuntu',
           },
         },
+        puppet_vardir: '/opt/puppetlabs/puppet/cache',
       }
     end
 
@@ -168,6 +172,7 @@ describe 'apt::ppa' do
             id: 'Ubuntu',
           },
         },
+        puppet_vardir: '/opt/puppetlabs/puppet/cache',
       }
     end
 
@@ -210,6 +215,7 @@ describe 'apt::ppa' do
             id: 'Ubuntu',
           },
         },
+        puppet_vardir: '/opt/puppetlabs/puppet/cache',
       }
     end
 
@@ -250,6 +256,7 @@ describe 'apt::ppa' do
             id: 'Ubuntu',
           },
         },
+        puppet_vardir: '/opt/puppetlabs/puppet/cache',
       }
     end
 
@@ -290,6 +297,7 @@ describe 'apt::ppa' do
             id: 'Ubuntu',
           },
         },
+        puppet_vardir: '/opt/puppetlabs/puppet/cache',
       }
     end
 
@@ -328,6 +336,7 @@ describe 'apt::ppa' do
             id: 'Ubuntu',
           },
         },
+        puppet_vardir: '/opt/puppetlabs/puppet/cache',
       }
     end