Skip to content

Commit b66e95a

Browse files
ehelmsevgeni
andauthored
Add parameter to enable iop-advisor-engine to rh_cloud plugin
Signed-off-by: Eric D. Helms <[email protected]> Co-authored-by: Evgeni Golov <[email protected]>
1 parent 89565c3 commit b66e95a

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

.fixtures.yml

+4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ fixtures:
33
apache: 'https://github.com/puppetlabs/puppetlabs-apache'
44
apt: 'https://github.com/puppetlabs/puppetlabs-apt'
55
augeas_core: 'https://github.com/puppetlabs/puppetlabs-augeas_core'
6+
certs: 'https://github.com/theforeman/puppet-certs'
67
concat: 'https://github.com/puppetlabs/puppetlabs-concat'
78
cron_core: 'https://github.com/puppetlabs/puppetlabs-cron_core'
89
extlib: 'https://github.com/voxpupuli/puppet-extlib'
10+
hashfile: 'https://github.com/southalc/hashfile'
11+
iop_advisor_engine: 'https://github.com/theforeman/puppet-iop_advisor_engine'
12+
podman: 'https://github.com/southalc/podman'
913
postgresql: 'https://github.com/puppetlabs/puppetlabs-postgresql'
1014
puppet: 'https://github.com/theforeman/puppet-puppet'
1115
redis: 'https://github.com/voxpupuli/puppet-redis'

manifests/plugin/rh_cloud.pp

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Installs rh_cloud plugin
2-
class foreman::plugin::rh_cloud {
1+
# @summary Installs rh_cloud plugin
2+
#
3+
# @param enable_iop_advisor_engine
4+
# Enable iop-advisor-engine integration
5+
#
6+
class foreman::plugin::rh_cloud (
7+
Boolean $enable_iop_advisor_engine = false,
8+
) {
39
foreman::plugin { 'rh_cloud':
10+
config => epp('foreman/rh_cloud.yaml.epp', { 'enable_iop_advisor_engine' => $enable_iop_advisor_engine }),
11+
}
12+
13+
class { 'iop_advisor_engine':
14+
ensure => bool2str($enable_iop_advisor_engine, 'present', 'absent'),
415
}
516
}

spec/acceptance/foreman_rh_cloud_spec.rb

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
it_behaves_like 'an idempotent resource' do
77
let(:manifest) do
88
<<-PUPPET
9+
# iop_advisor_engine requires foreman-proxy certs to talk back to Foreman
10+
# TODO: redesign the deployment in a way that it better aligns with our architecture
11+
file { '/etc/foreman-proxy':
12+
ensure => directory,
13+
}
14+
15+
group { 'foreman-proxy':
16+
ensure => present,
17+
}
18+
919
include foreman
1020
include foreman::plugin::rh_cloud
1121
PUPPET

templates/rh_cloud.yaml.epp

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<%- |
2+
Boolean $enable_iop_advisor_engine,
3+
| -%>
4+
---
5+
:foreman_rh_cloud:
6+
:use_local_advisor_engine: <%= $enable_iop_advisor_engine %>

0 commit comments

Comments
 (0)