diff --git a/.fixtures.yml b/.fixtures.yml index c3070de9..1152d6ab 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -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}" diff --git a/manifests/dispatch_router.pp b/manifests/dispatch_router.pp new file mode 100644 index 00000000..b6fb7f25 --- /dev/null +++ b/manifests/dispatch_router.pp @@ -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.', + } + } +} diff --git a/manifests/init.pp b/manifests/init.pp index c2b7242b..670f3805 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, @@ -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) @@ -319,6 +342,7 @@ } if $pulp { + apache::vhost { 'capsule': servername => $capsule_fqdn, port => 80, @@ -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, @@ -353,6 +377,13 @@ } } + + if $qpid_router { + class { 'capsule::dispatch_router': + require => Class['pulp'], + } + } + if $puppet { class { 'certs::puppet': hostname => $capsule_fqdn diff --git a/manifests/params.pp b/manifests/params.pp index 834a0c4d..391974a0 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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 } diff --git a/metadata.json b/metadata.json index a275b326..b7278c05 100644 --- a/metadata.json +++ b/metadata.json @@ -34,6 +34,9 @@ { "name": "katello-common", "version_requirement": ">= 0.0.1" + }, + { "name": "katello-qpid", + "version_requirement": ">= 1.0.0" } ] }