Skip to content

Commit e398f8c

Browse files
committed
ensure the collection pkg to be installed
1 parent 946a422 commit e398f8c

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

manifests/plugin/ansible.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
mode => '0640',
5959
}
6060

61+
if ($facts['os']['family'] in ['RedHat', 'Debian'] and $foreman_proxy::plugin::ansible::callback == 'theforeman.foreman.foreman') {
62+
ensure_packages(['ansible-collection-theforeman-foreman'])
63+
}
64+
6165
include foreman_proxy::plugin::dynflow
6266
include foreman_proxy::plugin::remote_execution::script
6367
if $install_runner {

spec/acceptance/ansible_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
it_behaves_like 'the default foreman proxy application'
99

10+
describe package('ansible-collection-theforeman-foreman') do
11+
it { is_expected.to be_installed }
12+
end
13+
1014
package_name = ['debian', 'ubuntu'].include?(os[:family]) ? 'python3-ansible-runner' : 'ansible-runner'
1115
describe package(package_name) do
1216
it { is_expected.to be_installed }

spec/classes/foreman_proxy__plugin__ansible_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
case os
1515
when 'debian-11-x86_64'
1616
it { should contain_package('python3-ansible-runner').with_ensure('installed') }
17+
it { should contain_package('ansible-collection-theforeman-foreman').with_ensure('installed') }
1718
when 'redhat-7-x86_64'
1819
it 'should include ansible-runner upstream repo' do
1920
should contain_yumrepo('ansible-runner')
2021
.with_ensure('absent')
2122
.that_comes_before('Package[ansible-runner]')
2223
end
2324
it { should contain_package('ansible-runner').with_ensure('installed') }
25+
it { should contain_package('ansible-collection-theforeman-foreman').with_ensure('installed') }
2426
end
2527

2628

0 commit comments

Comments
 (0)