Puppet Class: profile::openstack::base::rabbitmq

Defined in:
modules/profile/manifests/openstack/base/rabbitmq.pp

Overview

There are two similarly-named params here, '$rabbitmq_setup_nodes' and '$rabbitmq_nodes':

$rabbitmq_nodes is the list of nodes that rabbitmq clients should actually use; it will generally
 consist of wikimediacloud.org service names rather than physical hardware fqdns. These values
 will be baked into unpuppetized Trove VMs and so should be changed as little as possible; changes
 to active rabbit nodes should be made via dns changes to the service fqdns.

$rabbitmq_setup_nodes is a list of fqdns of hosts that are configured by this class but not yet
 in service. It exists to stage new rabbitmq nodes (with firewalls and such) before switching
 traffic over. It should consist of primary fqdns (.wikimedia.org or .wmnet)

Parameters:

  • $rabbitmq_setup_nodes

    List of rabbit nodes allowed in firewalls etc but not serving traffic

  • region (String) (defaults to: lookup('profile::openstack::base::region'))
  • openstack_controllers (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::openstack_controllers'))
  • rabbitmq_nodes (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::rabbitmq_nodes'))
  • rabbitmq_setup_nodes (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::rabbitmq_setup_nodes'))
  • rabbitmq_service_name (Stdlib::Fqdn) (defaults to: lookup('profile::openstack::base::rabbitmq_service_name'))
  • monitor_user (Any) (defaults to: lookup('profile::openstack::base::rabbit_monitor_user'))
  • monitor_password (Any) (defaults to: lookup('profile::openstack::base::rabbit_monitor_pass'))
  • cleanup_password (Any) (defaults to: lookup('profile::openstack::base::rabbit_cleanup_pass'))
  • file_handles (Any) (defaults to: lookup('profile::openstack::base::rabbit_file_handles'))
  • designate_hosts (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::designate_hosts'))
  • nova_rabbit_user (String) (defaults to: lookup('profile::openstack::base::nova::rabbit_user'))
  • nova_rabbit_password (String) (defaults to: lookup('profile::openstack::base::nova::rabbit_pass'))
  • neutron_rabbit_user (String) (defaults to: lookup('profile::openstack::base::neutron::rabbit_user'))
  • neutron_rabbit_password (String) (defaults to: lookup('profile::openstack::base::neutron::rabbit_pass'))
  • trove_guest_rabbit_user (String) (defaults to: lookup('profile::openstack::base::trove::trove_guest_rabbit_user'))
  • trove_guest_rabbit_pass (String) (defaults to: lookup('profile::openstack::base::trove::trove_guest_rabbit_pass'))
  • heat_rabbit_user (String) (defaults to: lookup('profile::openstack::base::heat::rabbit_user'))
  • heat_rabbit_password (String) (defaults to: lookup('profile::openstack::base::heat::rabbit_pass'))
  • magnum_rabbit_user (String) (defaults to: lookup('profile::openstack::base::magnum::rabbit_user'))
  • magnum_rabbit_password (String) (defaults to: lookup('profile::openstack::base::magnum::rabbit_pass'))
  • rabbit_erlang_cookie (Any) (defaults to: lookup('profile::openstack::base::rabbit_erlang_cookie'))
  • rabbit_cfssl_label (Optional[String]) (defaults to: lookup('profile::openstack::base::rabbitmq::rabbit_cfssl_label', {default_value => undef}))
  • cinder_backup_nodes (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::cinder::backup::nodes'))
  • heartbeat_timeout (Integer) (defaults to: lookup('profile::openstack::base::heartbeat_timeout'))


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'modules/profile/manifests/openstack/base/rabbitmq.pp', line 14

class profile::openstack::base::rabbitmq(
    String $region = lookup('profile::openstack::base::region'),
    Array[Stdlib::Fqdn] $openstack_controllers = lookup('profile::openstack::base::openstack_controllers'),
    Array[Stdlib::Fqdn] $rabbitmq_nodes = lookup('profile::openstack::base::rabbitmq_nodes'),
    Array[Stdlib::Fqdn] $rabbitmq_setup_nodes = lookup('profile::openstack::base::rabbitmq_setup_nodes'),
    Stdlib::Fqdn $rabbitmq_service_name = lookup('profile::openstack::base::rabbitmq_service_name'),
    $monitor_user = lookup('profile::openstack::base::rabbit_monitor_user'),
    $monitor_password = lookup('profile::openstack::base::rabbit_monitor_pass'),
    $cleanup_password = lookup('profile::openstack::base::rabbit_cleanup_pass'),
    $file_handles = lookup('profile::openstack::base::rabbit_file_handles'),
    Array[Stdlib::Fqdn] $designate_hosts = lookup('profile::openstack::base::designate_hosts'),
    String $nova_rabbit_user = lookup('profile::openstack::base::nova::rabbit_user'),
    String $nova_rabbit_password = lookup('profile::openstack::base::nova::rabbit_pass'),
    String $neutron_rabbit_user = lookup('profile::openstack::base::neutron::rabbit_user'),
    String $neutron_rabbit_password = lookup('profile::openstack::base::neutron::rabbit_pass'),
    String $trove_guest_rabbit_user = lookup('profile::openstack::base::trove::trove_guest_rabbit_user'),
    String $trove_guest_rabbit_pass = lookup('profile::openstack::base::trove::trove_guest_rabbit_pass'),
    String $heat_rabbit_user = lookup('profile::openstack::base::heat::rabbit_user'),
    String $heat_rabbit_password = lookup('profile::openstack::base::heat::rabbit_pass'),
    String $magnum_rabbit_user = lookup('profile::openstack::base::magnum::rabbit_user'),
    String $magnum_rabbit_password = lookup('profile::openstack::base::magnum::rabbit_pass'),
    $rabbit_erlang_cookie = lookup('profile::openstack::base::rabbit_erlang_cookie'),
    Optional[String] $rabbit_cfssl_label = lookup('profile::openstack::base::rabbitmq::rabbit_cfssl_label', {default_value => undef}),
    Array[Stdlib::Fqdn] $cinder_backup_nodes    = lookup('profile::openstack::base::cinder::backup::nodes'),
    Integer $heartbeat_timeout = lookup('profile::openstack::base::heartbeat_timeout'),
){
    if $rabbit_cfssl_label {
        $cert_paths = profile::pki::get_cert(
            $rabbit_cfssl_label,
            $facts['networking']['fqdn'],
            {
                outdir        => '/etc/rabbitmq/ssl',
                provide_chain => true,
                owner         => 'rabbitmq',
                group         => 'rabbitmq',
                require       => Package['rabbitmq-server'],
                before        => File['/etc/rabbitmq/rabbitmq.config'],
                notify        => Service['rabbitmq-server'],
                hosts         => [$rabbitmq_service_name]
            }
        )

        $rabbitmq_tls_key_file = $cert_paths['key']
        $rabbitmq_tls_cert_file = $cert_paths['chained']
        $rabbitmq_tls_ca_file = '/etc/ssl/certs/wmf-ca-certificates.crt'
    } else {
        $rabbitmq_tls_key_file = undef
        $rabbitmq_tls_cert_file = undef
        $rabbitmq_tls_ca_file = undef
    }

    class { '::rabbitmq':
        file_handles      => $file_handles,
        erlang_cookie     => $rabbit_erlang_cookie,
        tls_cert_file     => $rabbitmq_tls_cert_file,
        tls_key_file      => $rabbitmq_tls_key_file,
        tls_ca_file       => $rabbitmq_tls_ca_file,
        heartbeat_timeout => $heartbeat_timeout,
    }
    contain '::rabbitmq'

    # https://www.rabbitmq.com/management.html
    # Needed for https://www.rabbitmq.com/management-cli.html
    rabbitmq::plugin { 'rabbitmq_management': }

    file { '/etc/rabbitmq/rabbitmq-env.conf':
        owner   => 'rabbitmq',
        group   => 'rabbitmq',
        mode    => '0644',
        source  => 'puppet:///modules/profile/openstack/base/rabbitmq/rabbitmq-env.conf',
        require => Package['rabbitmq-server'],
        notify  => Service['rabbitmq-server'],
    }

    # We want this job to run on only one host; it doesn't matter which.
    class {'::rabbitmq::cleanup':
        password => $cleanup_password,
        enabled  => $rabbitmq_nodes[0] == $rabbitmq_service_name,
    }
    contain '::rabbitmq::cleanup'

    class { '::openstack::nova::rabbit':
        username => $nova_rabbit_user,
        password => $nova_rabbit_password,
    }

    class { '::openstack::neutron::rabbit':
        username => $neutron_rabbit_user,
        password => $neutron_rabbit_password,
    }

    class { '::openstack::heat::rabbit':
        username => $heat_rabbit_user,
        password => $heat_rabbit_password,
    }

    class { '::openstack::magnum::rabbit':
        username => $magnum_rabbit_user,
        password => $magnum_rabbit_password,
    }

    class { '::openstack::trove::rabbit':
        guest_username => $trove_guest_rabbit_user,
        guest_password => $trove_guest_rabbit_pass,
    }

    rabbitmq::plugin { 'rabbitmq_prometheus': }

    ferm::service { 'rabbitmq-internals':
        proto  => 'tcp',
        port   => '(4369 5671 5672 25672)',
        srange => "(@resolve((${rabbitmq_nodes.join(' ')} ${rabbitmq_setup_nodes.join(' ')})))",
    }

    $hosts_ranges = $::network::constants::cloud_nova_hosts_ranges[$region]

    ferm::service { 'rabbitmq-nova-hosts':
        proto  => 'tcp',
        port   => '(5671 5672)',
        srange => "(${hosts_ranges.join(' ')})",
    }

    ferm::service { 'rabbitmq-openstack-control':
        proto  => 'tcp',
        port   => '(5671 5672)',
        srange => "(@resolve((${openstack_controllers.join(' ')})))",
    }

    ferm::service { 'rabbitmq-designate':
        proto  => 'tcp',
        port   => '(5671 5672)',
        srange => "(@resolve((${designate_hosts.join(' ')})))",
    }

    ferm::service { 'rabbitmq-cinder-backup':
        proto  => 'tcp',
        port   => '(5671 5672)',
        srange => "(@resolve((${cinder_backup_nodes.join(' ')})))",
    }

    ferm::service { 'rabbitmq-cloud-vps-instances':
        proto  => 'tcp',
        port   => '(5671 5672)',
        srange => '$LABS_NETWORKS',
    }
}