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

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

Overview

Parameters:

  • version (Any) (defaults to: hiera('profile::openstack::base::version'))
  • designate_hosts (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::designate_hosts'))
  • openstack_controllers (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::openstack_controllers'))
  • keystone_api_fqdn (Stdlib::Fqdn) (defaults to: hiera('profile::openstack::base::keystone_api_fqdn'))
  • puppetmaster_hostname (Any) (defaults to: hiera('profile::openstack::base::puppetmaster_hostname'))
  • db_user (Any) (defaults to: hiera('profile::openstack::base::designate::db_user'))
  • db_pass (Any) (defaults to: hiera('profile::openstack::base::designate::db_pass'))
  • db_host (Any) (defaults to: hiera('profile::openstack::base::designate::db_host'))
  • db_name (Any) (defaults to: hiera('profile::openstack::base::designate::db_name'))
  • domain_id_internal_forward_legacy (Any) (defaults to: hiera('profile::openstack::base::designate::domain_id_internal_forward_legacy'))
  • domain_id_internal_forward (Any) (defaults to: hiera('profile::openstack::base::designate::domain_id_internal_forward'))
  • domain_id_internal_reverse (Any) (defaults to: hiera('profile::openstack::base::designate::domain_id_internal_reverse'))
  • ldap_user_pass (Any) (defaults to: hiera('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: hiera('profile::openstack::base::designate::db_admin_user'))
  • db_admin_pass (Any) (defaults to: hiera('profile::openstack::base::designate::db_admin_pass'))
  • pdns_hosts (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::designate::hosts'))
  • rabbit_user (Any) (defaults to: hiera('profile::openstack::base::nova::rabbit_user'))
  • rabbit_pass (Any) (defaults to: hiera('profile::openstack::base::nova::rabbit_pass'))
  • keystone_public_port (Any) (defaults to: hiera('profile::openstack::base::keystone::public_port'))
  • keystone_auth_port (Any) (defaults to: hiera('profile::openstack::base::keystone::auth_port'))
  • osm_host (Any) (defaults to: hiera('profile::openstack::base::osm_host'))
  • labweb_hosts (Any) (defaults to: hiera('profile::openstack::base::labweb_hosts'))
  • region (Any) (defaults to: hiera('profile::openstack::base::region'))
  • prometheus_nodes (Array[Stdlib::Fqdn]) (defaults to: lookup('prometheus_nodes'))
  • puppet_git_repo_name (Any) (defaults to: lookup('profile::openstack::base::horizon::puppet_git_repo_name'))
  • puppet_git_repo_user (Any) (defaults to: lookup('profile::openstack::base::horizon::puppet_git_repo_user'))
  • mcrouter_port (Integer) (defaults to: lookup('profile::openstack::base::designate::mcrouter_port'))


1
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'modules/profile/manifests/openstack/base/designate/service.pp', line 1

class profile::openstack::base::designate::service(
    $version = hiera('profile::openstack::base::version'),
    Array[Stdlib::Fqdn] $designate_hosts = lookup('profile::openstack::base::designate_hosts'),
    Array[Stdlib::Fqdn] $openstack_controllers = lookup('profile::openstack::base::openstack_controllers'),
    Stdlib::Fqdn $keystone_api_fqdn = hiera('profile::openstack::base::keystone_api_fqdn'),
    $puppetmaster_hostname = hiera('profile::openstack::base::puppetmaster_hostname'),
    $db_user = hiera('profile::openstack::base::designate::db_user'),
    $db_pass = hiera('profile::openstack::base::designate::db_pass'),
    $db_host = hiera('profile::openstack::base::designate::db_host'),
    $db_name = hiera('profile::openstack::base::designate::db_name'),
    $domain_id_internal_forward_legacy = hiera('profile::openstack::base::designate::domain_id_internal_forward_legacy'),
    $domain_id_internal_forward = hiera('profile::openstack::base::designate::domain_id_internal_forward'),
    $domain_id_internal_reverse = hiera('profile::openstack::base::designate::domain_id_internal_reverse'),
    $ldap_user_pass = hiera('profile::openstack::base::ldap_user_pass'),
    $pdns_api_key = lookup('profile::openstack::base::pdns::api_key'),
    $db_admin_user = hiera('profile::openstack::base::designate::db_admin_user'),
    $db_admin_pass = hiera('profile::openstack::base::designate::db_admin_pass'),
    Array[Stdlib::Fqdn] $pdns_hosts = lookup('profile::openstack::base::designate::hosts'),
    $rabbit_user = hiera('profile::openstack::base::nova::rabbit_user'),
    $rabbit_pass = hiera('profile::openstack::base::nova::rabbit_pass'),
    $keystone_public_port = hiera('profile::openstack::base::keystone::public_port'),
    $keystone_auth_port = hiera('profile::openstack::base::keystone::auth_port'),
    $osm_host = hiera('profile::openstack::base::osm_host'),
    $labweb_hosts = hiera('profile::openstack::base::labweb_hosts'),
    $region = hiera('profile::openstack::base::region'),
    Array[Stdlib::Fqdn] $prometheus_nodes = lookup('prometheus_nodes'),
    $puppet_git_repo_name = lookup('profile::openstack::base::horizon::puppet_git_repo_name'),
    $puppet_git_repo_user = lookup('profile::openstack::base::horizon::puppet_git_repo_user'),
    Integer $mcrouter_port = lookup('profile::openstack::base::designate::mcrouter_port'),
    ) {

    class{'::openstack::designate::service':
        active                            => true,
        version                           => $version,
        designate_hosts                   => $designate_hosts,
        keystone_api_fqdn                 => $keystone_api_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,
        openstack_controllers             => $openstack_controllers,
        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,
        rabbit_user                       => $rabbit_user,
        rabbit_pass                       => $rabbit_pass,
        keystone_public_port              => $keystone_public_port,
        keystone_auth_port                => $keystone_auth_port,
        region                            => $region,
        puppet_git_repo_name              => $puppet_git_repo_name,
        puppet_git_repo_user              => $puppet_git_repo_user,
    }
    contain '::openstack::designate::service'

    $labweb_ips = inline_template("@resolve((<%= @labweb_hosts.join(' ') %>))")
    $labweb_ip6s = inline_template("@resolve((<%= @labweb_hosts.join(' ') %>), AAAA)")
    $prometheus_ferm_nodes = join($prometheus_nodes, ' ')
    $prometheus_ferm_srange = "@resolve((${prometheus_ferm_nodes})) @resolve((${prometheus_ferm_nodes}), AAAA)"
    # Open designate API to WMCS web UIs and the commandline on control servers, also prometheus
    ferm::rule { 'designate-api':
        rule => "saddr (@resolve((${join($openstack_controllers,' ')}))
                        @resolve((${join($openstack_controllers,' ')}), AAAA)
                        ${prometheus_ferm_srange}
                 ) proto tcp dport (9001) ACCEPT;",
    }

    # allow axfr traffic between mdns and pdns on the pdns hosts
    ferm::rule { 'mdns-axfr':
        rule => "saddr (@resolve((${join($designate_hosts,' ')}))
                        @resolve((${join($designate_hosts,' ')}), AAAA))
                 proto tcp dport (5354) ACCEPT;",
    }

    ferm::rule { 'mdns-axfr-udp':
        rule => "saddr (@resolve((${join($designate_hosts,' ')}))
                        @resolve((${join($designate_hosts,' ')}), AAAA))
                 proto udp dport (5354) ACCEPT;",
    }

    # 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:11000: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'
                }
            }
        ]
    }

    class { '::memcached':
        # TODO: the following were implicit defaults from
        # MW settings, need to be reviewed.
        growth_factor => 1.05,
        min_slab_size => 5,
    }
    class { '::profile::prometheus::memcached_exporter': }

    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))",
    }

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

    openstack::db::project_grants { 'designate':
        access_hosts => $designate_hosts + $openstack_controllers,
        db_name      => $db_name,
        db_user      => $db_user,
        db_pass      => $db_pass,
    }
}