Skip to content

Commit

Permalink
refs #8175 - configure dispatch router on capsule
Browse files Browse the repository at this point in the history
  • Loading branch information
stbenjam committed Feb 19, 2015
1 parent f1f98cf commit d542816
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 2 deletions.
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}"
61 changes: 61 additions & 0 deletions manifests/dispatch_router.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# == 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 => Package['qpid-dispatch-router'],
} ~>
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-queue':
prefix => 'queue.',
connector => 'broker',
}
} else {
qpid::router::connector { 'hub':
addr => $capsule::parent_fqdn,
port => $capsule::qpid_router_hub_port,
ssl_profile => 'client',
role => 'inter-router',
}
}
}
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
# 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"
}
]
}

0 comments on commit d542816

Please sign in to comment.