Skip to content

Commit 65e0324

Browse files
authored
Merge pull request #1056 from puppetlabs/gh-1055-hardcoded_cache_path
(GH-1055) Fix hardcoded cache path
2 parents dad7d73 + 58265f3 commit 65e0324

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

manifests/ppa.pp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@
6767
$trusted_gpg_d_filename = "${dash_filename_no_specialchars}.gpg"
6868
}
6969

70-
# This is the location of our main exec script
71-
$script_path = "/opt/puppetlabs/puppet/cache/add-apt-repository-${dash_filename_no_specialchars}-${release}.sh"
70+
# This is the location of our main exec script.
71+
$cache_path = $facts['puppet_vardir']
72+
$script_path = "${cache_path}/add-apt-repository-${dash_filename_no_specialchars}-${release}.sh"
7273

7374
if $ensure == 'present' {
7475
if $package_manage {

spec/defines/ppa_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
3030
id: 'Ubuntu',
3131
},
3232
},
33+
puppet_vardir: '/opt/puppetlabs/puppet/cache'
3334
}
3435
end
3536

@@ -58,6 +59,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
5859
id: 'Ubuntu',
5960
},
6061
},
62+
puppet_vardir: '/opt/puppetlabs/puppet/cache',
6163
}
6264
end
6365

@@ -96,6 +98,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
9698
id: 'Ubuntu',
9799
},
98100
},
101+
puppet_vardir: '/opt/puppetlabs/puppet/cache',
99102
}
100103
end
101104

@@ -128,6 +131,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
128131
id: 'Ubuntu',
129132
},
130133
},
134+
puppet_vardir: '/opt/puppetlabs/puppet/cache',
131135
}
132136
end
133137

@@ -168,6 +172,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
168172
id: 'Ubuntu',
169173
},
170174
},
175+
puppet_vardir: '/opt/puppetlabs/puppet/cache',
171176
}
172177
end
173178

@@ -210,6 +215,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
210215
id: 'Ubuntu',
211216
},
212217
},
218+
puppet_vardir: '/opt/puppetlabs/puppet/cache',
213219
}
214220
end
215221

@@ -250,6 +256,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
250256
id: 'Ubuntu',
251257
},
252258
},
259+
puppet_vardir: '/opt/puppetlabs/puppet/cache',
253260
}
254261
end
255262

@@ -290,6 +297,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
290297
id: 'Ubuntu',
291298
},
292299
},
300+
puppet_vardir: '/opt/puppetlabs/puppet/cache',
293301
}
294302
end
295303

@@ -328,6 +336,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
328336
id: 'Ubuntu',
329337
},
330338
},
339+
puppet_vardir: '/opt/puppetlabs/puppet/cache',
331340
}
332341
end
333342

0 commit comments

Comments
 (0)