Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refs #8175 - configure dispatch router on pulp and pulp nodes #34

Merged
merged 1 commit into from
Feb 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ fixtures:
xinetd: "git://github.com/puppetlabs/puppetlabs-xinetd.git"
common: "git://github.com/katello/puppet-common.git"
certs: "git://github.com/katello/puppet-certs.git"
qpid: "git://github.com/katello/puppet-qpid.git"
symlinks:
capsule: "#{source_dir}"
74 changes: 74 additions & 0 deletions manifests/dispatch_router.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# == Class: capsule::dispatch_router
#
# Install and configure Qpid Dispatch Router
#
class capsule::dispatch_router (
) {

class { 'qpid::router': }

# SSL Certificate Configuration
class { 'certs::qpid_router':
require => Class['qpid::router::install'],
} ~>
qpid::router::ssl_profile { 'client':
ca => $certs::ca_cert,
cert => $certs::qpid_router::client_cert,
key => $certs::qpid_router::client_key,
} ~>
qpid::router::ssl_profile { 'server':
ca => $certs::ca_cert,
cert => $certs::qpid_router::server_cert,
key => $certs::qpid_router::server_key,
}

# Listen for katello-agent clients
qpid::router::listener { 'clients':
addr => $capsule::qpid_router_agent_addr,
port => $capsule::qpid_router_agent_port,
ssl_profile => 'server',
}

# Act as hub if pulp master, otherwise connect to hub
if $capsule::pulp_master {
qpid::router::listener {'hub':
addr => $capsule::qpid_router_hub_addr,
port => $capsule::qpid_router_hub_port,
role => 'inter-router',
ssl_profile => 'server',
}

# Connect dispatch router to the local qpid
qpid::router::connector { 'broker':
addr => $capsule::qpid_router_broker_addr,
port => $capsule::qpid_router_broker_port,
ssl_profile => 'client',
role => 'on-demand',
}

qpid::router::link_route_pattern { 'broker-pulp-route':
prefix => 'pulp.',
connector => 'broker',
}

qpid::router::link_route_pattern { 'broker-qmf-route':
prefix => 'qmf.',
connector => 'broker',
}
} else {
qpid::router::connector { 'hub':
addr => $capsule::parent_fqdn,
port => $capsule::qpid_router_hub_port,
ssl_profile => 'client',
role => 'inter-router',
}

qpid::router::link_route_pattern { 'hub-pulp-route':
prefix => 'pulp.',
}

qpid::router::link_route_pattern { 'hub-qmf-route':
prefix => 'qmf.',
}
}
}
35 changes: 33 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@
# $templates:: Enable templates proxying feature
# type:boolean
#
# $qpid_router:: Configure qpid dispatch router
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter doesn't look like it is used anywhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now

# type:boolean
#
# $qpid_router_hub_addr:: Address for dispatch router hub
#
# $qpid_router_hub_port:: Port for dispatch router hub
#
# $qpid_router_agent_addr:: Listener address for goferd agents
#
# $qpid_router_agent_port:: Listener port for goferd agents
#
# $qpid_router_broker_addr:: Address of qpidd broker to connect to
#
# $qpid_router_broker_port:: Port of qpidd broker to connect to
#
class capsule (
$parent_fqdn = $capsule::params::parent_fqdn,
$certs_tar = $capsule::params::certs_tar,
Expand Down Expand Up @@ -204,7 +219,15 @@
$rhsm_url = $capsule::params::rhsm_url,

$templates = $capsule::params::templates,
) inherits capsule::params {

$qpid_router = $capsule::params::qpid_router,
$qpid_router_hub_addr = $capsule::params::qpid_router_hub_addr,
$qpid_router_hub_port = $capsule::params::qpid_router_hub_port,
$qpid_router_agent_addr = $capsule::params::qpid_router_agent_addr,
$qpid_router_agent_port = $capsule::params::qpid_router_agent_port,
$qpid_router_broker_addr = $capsule::params::qpid_router_broker_addr,
$qpid_router_broker_port = $capsule::params::qpid_router_broker_port,
) inherits capsule::params {

validate_present($capsule::parent_fqdn)

Expand Down Expand Up @@ -319,6 +342,7 @@
}

if $pulp {

apache::vhost { 'capsule':
servername => $capsule_fqdn,
port => 80,
Expand All @@ -337,7 +361,7 @@
qpid_ssl_cert_password_file => $certs::qpid::nss_db_password_file,
messaging_ca_cert => $certs::ca_cert,
messaging_client_cert => $certs::params::messaging_client_cert,
messaging_url => "ssl://${::fqdn}:5671"
messaging_url => "ssl://${::fqdn}:5671",
} ~>
class { 'pulp::child':
parent_fqdn => $parent_fqdn,
Expand All @@ -353,6 +377,13 @@
}
}


if $qpid_router {
class { 'capsule::dispatch_router':
require => Class['pulp'],
}
}

if $puppet {
class { 'certs::puppet':
hostname => $capsule_fqdn
Expand Down
8 changes: 8 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,12 @@
$certs_tar = undef

$rhsm_url = '/rhsm'

$qpid_router = true
$qpid_router_hub_addr = '0.0.0.0'
$qpid_router_agent_addr = '0.0.0.0'
$qpid_router_broker_addr = $::fqdn
$qpid_router_hub_port = 5646
$qpid_router_agent_port = 5647
$qpid_router_broker_port = 5671
}
3 changes: 3 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
{
"name": "katello-common",
"version_requirement": ">= 0.0.1"
},
{ "name": "katello-qpid",
"version_requirement": ">= 1.0.0"
}
]
}