Skip to content

Commit

Permalink
ensure the collection pkg to be installed
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Feb 28, 2023
1 parent 946a422 commit e398f8c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifests/plugin/ansible.pp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
mode => '0640',
}

if ($facts['os']['family'] in ['RedHat', 'Debian'] and $foreman_proxy::plugin::ansible::callback == 'theforeman.foreman.foreman') {
ensure_packages(['ansible-collection-theforeman-foreman'])
}

include foreman_proxy::plugin::dynflow
include foreman_proxy::plugin::remote_execution::script
if $install_runner {
Expand Down
4 changes: 4 additions & 0 deletions spec/acceptance/ansible_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

it_behaves_like 'the default foreman proxy application'

describe package('ansible-collection-theforeman-foreman') do
it { is_expected.to be_installed }
end

package_name = ['debian', 'ubuntu'].include?(os[:family]) ? 'python3-ansible-runner' : 'ansible-runner'
describe package(package_name) do
it { is_expected.to be_installed }
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/foreman_proxy__plugin__ansible_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
case os
when 'debian-11-x86_64'
it { should contain_package('python3-ansible-runner').with_ensure('installed') }
it { should contain_package('ansible-collection-theforeman-foreman').with_ensure('installed') }
when 'redhat-7-x86_64'
it 'should include ansible-runner upstream repo' do
should contain_yumrepo('ansible-runner')
.with_ensure('absent')
.that_comes_before('Package[ansible-runner]')
end
it { should contain_package('ansible-runner').with_ensure('installed') }
it { should contain_package('ansible-collection-theforeman-foreman').with_ensure('installed') }
end


Expand Down

0 comments on commit e398f8c

Please sign in to comment.