Puppet Class: profile::openstack::base::designate::service

Defined in:
modules/profile/manifests/openstack/base/designate/service.pp

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • version (Any) (defaults to: lookup('profile::openstack::base::version'))
  • designate_hosts (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::designate_hosts'))
  • openstack_control_nodes (Array[OpenStack::ControlNode]) (defaults to: lookup('profile::openstack::base::openstack_control_nodes'))
  • keystone_fqdn (Stdlib::Fqdn) (defaults to: lookup('profile::openstack::base::keystone_api_fqdn'))
  • puppetmaster_hostname (Any) (defaults to: lookup('profile::openstack::base::puppetmaster_hostname'))
  • db_user (Any) (defaults to: lookup('profile::openstack::base::designate::db_user'))
  • db_pass (Any) (defaults to: lookup('profile::openstack::base::designate::db_pass'))
  • db_host (Any) (defaults to: lookup('profile::openstack::base::designate::db_host'))
  • db_name (Any) (defaults to: lookup('profile::openstack::base::designate::db_name'))
  • domain_id_internal_forward_legacy (Any) (defaults to: lookup('profile::openstack::base::designate::domain_id_internal_forward_legacy'))
  • domain_id_internal_forward (Any) (defaults to: lookup('profile::openstack::base::designate::domain_id_internal_forward'))
  • domain_id_internal_reverse (Any) (defaults to: lookup('profile::openstack::base::designate::domain_id_internal_reverse'))
  • ldap_user_pass (Any) (defaults to: lookup('profile::openstack::base::ldap_user_pass'))
  • pdns_api_key (Any) (defaults to: lookup('profile::openstack::base::pdns::api_key'))
  • db_admin_user (Any) (defaults to: lookup('profile::openstack::base::designate::db_admin_user'))
  • db_admin_pass (Any) (defaults to: lookup('profile::openstack::base::designate::db_admin_pass'))
  • pdns_hosts (Array[Hash]) (defaults to: lookup('profile::openstack::base::pdns::hosts'))
  • rabbitmq_nodes (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::rabbitmq_nodes'))
  • rabbit_user (Any) (defaults to: lookup('profile::openstack::base::designate::rabbit_user'))
  • rabbit_pass (Any) (defaults to: lookup('profile::openstack::base::designate::rabbit_pass'))
  • enforce_policy_scope (Boolean) (defaults to: lookup('profile::openstack::base::keystone::enforce_policy_scope'))
  • enforce_new_policy_defaults (Boolean) (defaults to: lookup('profile::openstack::base::keystone::enforce_new_policy_defaults'))
  • osm_host (Any) (defaults to: lookup('profile::openstack::base::osm_host'))
  • region (Any) (defaults to: lookup('profile::openstack::base::region'))
  • mcrouter_port (Integer) (defaults to: lookup('profile::openstack::base::designate::mcrouter_port'))
  • haproxy_nodes (Array[Stdlib::Host]) (defaults to: lookup('profile::openstack::base::haproxy_nodes'))


2
3
4
5
6
7
8
9
10
11
12
13
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
# File 'modules/profile/manifests/openstack/base/designate/service.pp', line 2

class profile::openstack::base::designate::service(
    $version = lookup('profile::openstack::base::version'),
    Array[Stdlib::Fqdn] $designate_hosts = lookup('profile::openstack::base::designate_hosts'),
    Array[OpenStack::ControlNode] $openstack_control_nodes = lookup('profile::openstack::base::openstack_control_nodes'),
    Stdlib::Fqdn $keystone_fqdn = lookup('profile::openstack::base::keystone_api_fqdn'),
    $puppetmaster_hostname = lookup('profile::openstack::base::puppetmaster_hostname'),
    $db_user = lookup('profile::openstack::base::designate::db_user'),
    $db_pass = lookup('profile::openstack::base::designate::db_pass'),
    $db_host = lookup('profile::openstack::base::designate::db_host'),
    $db_name = lookup('profile::openstack::base::designate::db_name'),
    $domain_id_internal_forward_legacy = lookup('profile::openstack::base::designate::domain_id_internal_forward_legacy'),
    $domain_id_internal_forward = lookup('profile::openstack::base::designate::domain_id_internal_forward'),
    $domain_id_internal_reverse = lookup('profile::openstack::base::designate::domain_id_internal_reverse'),
    $ldap_user_pass = lookup('profile::openstack::base::ldap_user_pass'),
    $pdns_api_key = lookup('profile::openstack::base::pdns::api_key'),
    $db_admin_user = lookup('profile::openstack::base::designate::db_admin_user'),
    $db_admin_pass = lookup('profile::openstack::base::designate::db_admin_pass'),
    Array[Hash] $pdns_hosts = lookup('profile::openstack::base::pdns::hosts'),
    Array[Stdlib::Fqdn] $rabbitmq_nodes = lookup('profile::openstack::base::rabbitmq_nodes'),
    $rabbit_user = lookup('profile::openstack::base::designate::rabbit_user'),
    $rabbit_pass = lookup('profile::openstack::base::designate::rabbit_pass'),
    Boolean $enforce_policy_scope = lookup('profile::openstack::base::keystone::enforce_policy_scope'),
    Boolean $enforce_new_policy_defaults = lookup('profile::openstack::base::keystone::enforce_new_policy_defaults'),
    $osm_host = lookup('profile::openstack::base::osm_host'),
    $region = lookup('profile::openstack::base::region'),
    Integer $mcrouter_port = lookup('profile::openstack::base::designate::mcrouter_port'),
    Array[Stdlib::Host] $haproxy_nodes = lookup('profile::openstack::base::haproxy_nodes'),
) {
    # required by the BGP anycast setup
    class { 'nagios_common::check_dns_query': }

    class{'::openstack::designate::service':
        active                            => true,
        version                           => $version,
        designate_hosts                   => $designate_hosts,
        keystone_fqdn                     => $keystone_fqdn,
        db_user                           => $db_user,
        db_pass                           => $db_pass,
        db_host                           => $db_host,
        db_name                           => $db_name,
        domain_id_internal_forward        => $domain_id_internal_forward,
        domain_id_internal_forward_legacy => $domain_id_internal_forward_legacy,
        domain_id_internal_reverse        => $domain_id_internal_reverse,
        puppetmaster_hostname             => $puppetmaster_hostname,
        memcached_nodes                   => $openstack_control_nodes.map |$node| { $node['cloud_private_fqdn'] },
        ldap_user_pass                    => $ldap_user_pass,
        pdns_api_key                      => $pdns_api_key,
        db_admin_user                     => $db_admin_user,
        db_admin_pass                     => $db_admin_pass,
        pdns_hosts                        => $pdns_hosts,
        rabbitmq_nodes                    => $rabbitmq_nodes,
        rabbit_user                       => $rabbit_user,
        rabbit_pass                       => $rabbit_pass,
        region                            => $region,
        enforce_policy_scope              => $enforce_policy_scope,
        enforce_new_policy_defaults       => $enforce_new_policy_defaults,
    }
    contain '::openstack::designate::service'

    ferm::service { 'designate-api-backend':
        proto  => 'tcp',
        port   => 9001,
        srange => "@resolve((${haproxy_nodes.join(' ')}))",
    }

    $raw_pdns_hosts = $pdns_hosts.map |$host| { $host['auth_fqdn'] }
    $pdns_hosts_private = $pdns_hosts.map |$host| { $host['private_fqdn'] }
    $mdns_clients = flatten([$designate_hosts, $raw_pdns_hosts, $pdns_hosts_private])
    # allow axfr traffic between mdns and pdns on the pdns hosts
    firewall::service { 'mdns-axfr-tcp':
        proto  => 'tcp',
        port   => 5354,
        srange => $mdns_clients,
    }

    firewall::service { 'mdns-axfr-udp':
        proto  => 'udp',
        port   => 5354,
        srange => $mdns_clients,
    }

    # Replicated cache set including all designate hosts.
    # This will be used for tooz coordination by designate.
    #
    # The route config here is copy/pasted from
    #  https://github.com/facebook/mcrouter/wiki/Replicated-pools-setup
    #
    # The cross-region bits don't actually matter but the parent class expects them.
    class { '::mcrouter':
        region      => $::site,
        cluster     => 'designate',
        pools       => {
            'designate' => {
                servers => $designate_hosts.map |$designatehost| { sprintf('%s:11211:ascii:plain',ipresolve($designatehost,4)) }
            },
        },
        routes      => [
            aliases => [ "/${::site}/designate/" ],
            route   => {
                type               => 'OperationSelectorRoute',
                default_policy     => 'PoolRoute|designate',
                operation_policies => {
                    add    => 'AllSyncRoute|Pool|designate',
                    delete => 'AllSyncRoute|Pool|designate',
                    get    => 'LatestRoute|Pool|designate',
                    set    => 'AllSyncRoute|Pool|designate'
                }
            }
        ]
    }


    ferm::rule { 'skip_mcrouter_designate_conntrack_out':
        desc  => 'Skip outgoing connection tracking for mcrouter',
        table => 'raw',
        chain => 'OUTPUT',
        rule  => "proto tcp sport (${mcrouter_port}) NOTRACK;",
    }

    ferm::rule { 'skip_mcrouter_designate_conntrack_in':
        desc  => 'Skip incoming connection tracking for mcrouter',
        table => 'raw',
        chain => 'PREROUTING',
        rule  => "proto tcp dport (${mcrouter_port}) NOTRACK;",
    }

    ferm::service { 'mcrouter':
        desc    => 'Allow connections to mcrouter',
        proto   => 'tcp',
        notrack => true,
        port    => $mcrouter_port,
        srange  => "(@resolve((${join($designate_hosts,' ')}))
                    @resolve((${join($designate_hosts,' ')}), AAAA))",
    }

    openstack::db::project_grants { 'designate':
        access_hosts => $designate_hosts + $haproxy_nodes,
        db_name      => $db_name,
        db_user      => $db_user,
        db_pass      => $db_pass,
        require      => Package['designate'],
    }
}