Skip to content

Commit 629c30f

Browse files
committed
change ownership of downloaded fdi-image to proxy user/group
1 parent 46d24ed commit 629c30f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

manifests/plugin/discovery.pp

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
foreman_proxy::remote_file { "${tftp_root_clean}/boot/${image_name}":
4242
remote_location => "${source_url}${image_name}",
4343
mode => '0644',
44+
owner => $foreman_proxy::user,
45+
group => $foreman_proxy::group,
4446
} ~> exec { "untar ${image_name}":
4547
command => "tar xf ${image_name}",
4648
path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',

spec/classes/foreman_proxy__plugin__discovery_spec.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
'foreman-proxy'
3232
end
3333
end
34+
let(:user) { group }
3435

3536
describe 'without paramaters' do
3637
it { should compile.with_all_deps }
@@ -62,8 +63,11 @@
6263
it { should contain_foreman_proxy__feature('Discovery') }
6364

6465
it 'should download and install tarball' do
65-
should contain_foreman_proxy__remote_file("#{tftproot}/boot/fdi-image-latest.tar").
66-
with_remote_location('http://downloads.theforeman.org/discovery/releases/latest/fdi-image-latest.tar')
66+
should contain_foreman_proxy__remote_file("#{tftproot}/boot/fdi-image-latest.tar").with(
67+
remote_location: 'http://downloads.theforeman.org/discovery/releases/latest/fdi-image-latest.tar',
68+
owner: user,
69+
group: group,
70+
)
6771
end
6872

6973
it 'should extract the tarball' do

0 commit comments

Comments
 (0)