Skip to content

Commit 83527a2

Browse files
committed
Fixes #32037: Add flag to enable katello_agent infrastructure and disable it by default
1 parent faf5e22 commit 83527a2

File tree

5 files changed

+88
-15
lines changed

5 files changed

+88
-15
lines changed

manifests/dispatch_router.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
#
2121
# @param ssl_protocols
2222
# Protocols to support in dispatch router (e.g. TLSv1.2, etc)
23+
#
24+
# @param ensure
25+
# Specify to explicitly enable Qpid installs or absent to remove all packages and configs
26+
#
2327
class foreman_proxy_content::dispatch_router (
2428
Optional[Stdlib::Host] $agent_addr = undef,
2529
Stdlib::Port $agent_port = 5647,
@@ -30,8 +34,13 @@
3034
String $logging_level = 'info+',
3135
Enum['file', 'syslog'] $logging = 'syslog',
3236
Stdlib::Absolutepath $logging_path = '/var/log/qdrouterd',
37+
38+
Enum['present', 'absent'] $ensure = 'present',
3339
) {
3440

41+
class { 'qpid::router':
42+
ensure => $ensure,
43+
}
3544
contain qpid::router
3645

3746
include certs::qpid_router::server

manifests/init.pp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#
1313
# $enable_deb:: Enable debian content plugin
1414
#
15+
# $enable_katello_agent:: Enable katello-agent for remote yum actions
16+
#
1517
# $pulpcore_mirror:: Deploy Pulp to be used as a mirror
1618
#
1719
# === Advanced parameters:
@@ -22,8 +24,6 @@
2224
#
2325
# $reverse_proxy_port:: Reverse proxy listening port
2426
#
25-
# $qpid_router:: Configure qpid dispatch router
26-
#
2727
# $qpid_router_hub_addr:: Address for dispatch router hub
2828
#
2929
# $qpid_router_hub_port:: Port for dispatch router hub
@@ -87,7 +87,6 @@
8787
Boolean $reverse_proxy = false,
8888
Stdlib::Port $reverse_proxy_port = 8443,
8989

90-
Boolean $qpid_router = true,
9190
Optional[String] $qpid_router_hub_addr = undef,
9291
Stdlib::Port $qpid_router_hub_port = 5646,
9392
Optional[String] $qpid_router_agent_addr = undef,
@@ -105,6 +104,8 @@
105104
Boolean $enable_docker = true,
106105
Boolean $enable_deb = true,
107106

107+
Boolean $enable_katello_agent = false,
108+
108109
Boolean $pulpcore_manage_postgresql = true,
109110
Stdlib::Host $pulpcore_postgresql_host = 'localhost',
110111
Stdlib::Port $pulpcore_postgresql_port = 5432,
@@ -155,18 +156,19 @@
155156

156157
include foreman_proxy_content::pub_dir
157158

158-
if $qpid_router {
159-
class { 'foreman_proxy_content::dispatch_router':
160-
agent_addr => $qpid_router_agent_addr,
161-
agent_port => $qpid_router_agent_port,
162-
ssl_ciphers => $qpid_router_ssl_ciphers,
163-
ssl_protocols => $qpid_router_ssl_protocols,
164-
logging_level => $qpid_router_logging_level,
165-
logging => $qpid_router_logging,
166-
logging_path => $qpid_router_logging_path,
167-
}
168-
contain foreman_proxy_content::dispatch_router
159+
class { 'foreman_proxy_content::dispatch_router':
160+
agent_addr => $qpid_router_agent_addr,
161+
agent_port => $qpid_router_agent_port,
162+
ssl_ciphers => $qpid_router_ssl_ciphers,
163+
ssl_protocols => $qpid_router_ssl_protocols,
164+
logging_level => $qpid_router_logging_level,
165+
logging => $qpid_router_logging,
166+
logging_path => $qpid_router_logging_path,
167+
ensure => bool2str($enable_katello_agent, 'present', 'absent'),
168+
}
169+
contain foreman_proxy_content::dispatch_router
169170

171+
if $enable_katello_agent {
170172
if $pulpcore_mirror {
171173
class { 'foreman_proxy_content::dispatch_router::connector':
172174
host => $foreman_host,

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
{
2828
"name": "katello/qpid",
29-
"version_requirement": ">= 4.5.0 < 8.0.0"
29+
"version_requirement": ">= 7.1.0 < 8.0.0"
3030
},
3131
{
3232
"name": "katello/certs",
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
require 'spec_helper_acceptance'
2+
3+
describe 'dispatch_router' do
4+
context 'with default parameters' do
5+
let(:pp) do
6+
<<-PUPPET
7+
include foreman_proxy_content::dispatch_router
8+
PUPPET
9+
end
10+
11+
it_behaves_like 'a idempotent resource'
12+
13+
describe service('qdrouterd') do
14+
it { is_expected.to be_running }
15+
it { is_expected.to be_enabled }
16+
end
17+
18+
describe port('5647') do
19+
it { is_expected.to be_listening }
20+
end
21+
end
22+
23+
context 'with ensure absent' do
24+
let(:pp) do
25+
<<-PUPPET
26+
class { 'foreman_proxy_content::dispatch_router':
27+
ensure => 'absent',
28+
}
29+
PUPPET
30+
end
31+
32+
it_behaves_like 'a idempotent resource'
33+
34+
describe service('qdrouterd') do
35+
it { is_expected.not_to be_running }
36+
it { is_expected.not_to be_enabled }
37+
end
38+
39+
describe port('5647') do
40+
it { is_expected.not_to be_listening }
41+
end
42+
end
43+
end

spec/setup_acceptance_node.pp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,22 @@
1212
package { 'policycoreutils':
1313
ensure => installed,
1414
}
15+
16+
if $facts['os']['release']['major'] == '8' {
17+
package { 'glibc-langpack-en':
18+
ensure => installed,
19+
}
20+
21+
yumrepo { 'powertools':
22+
enabled => true,
23+
}
24+
25+
yumrepo { 'katello':
26+
baseurl => "http://yum.theforeman.org/katello/nightly/katello/el8/x86_64/",
27+
gpgcheck => 0,
28+
}
29+
} elsif $facts['os']['release']['major'] == '7' {
30+
package { 'epel-release':
31+
ensure => installed,
32+
}
33+
}

0 commit comments

Comments
 (0)