Puppet Class: openstack::designate::service

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

Overview

Parameters:

  • active (Any)
  • version (Any)
  • designate_hosts (Array[Stdlib::Fqdn])
  • keystone_api_fqdn (Stdlib::Fqdn)
  • db_user (Any)
  • db_pass (Any)
  • db_host (Any)
  • db_name (Any)
  • domain_id_internal_forward (Any)
  • domain_id_internal_forward_legacy (Any)
  • domain_id_internal_reverse (Any)
  • puppetmaster_hostname (Any)
  • openstack_controllers (Array[Stdlib::Fqdn])
  • ldap_user_pass (Any)
  • pdns_api_key (Any)
  • db_admin_user (Any)
  • db_admin_pass (Any)
  • pdns_hosts (Any)
  • rabbit_user (Any)
  • rabbit_pass (Any)
  • keystone_public_port (Any)
  • keystone_auth_port (Any)
  • region (Any)
  • puppet_git_repo_name (Any)
  • puppet_git_repo_user (Any)


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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'modules/openstack/manifests/designate/service.pp', line 4

class openstack::designate::service(
    $active,
    $version,
    Array[Stdlib::Fqdn] $designate_hosts,
    Stdlib::Fqdn $keystone_api_fqdn,
    $db_user,
    $db_pass,
    $db_host,
    $db_name,
    $domain_id_internal_forward,
    $domain_id_internal_forward_legacy,
    $domain_id_internal_reverse,
    $puppetmaster_hostname,
    Array[Stdlib::Fqdn] $openstack_controllers,
    $ldap_user_pass,
    $pdns_api_key,
    $db_admin_user,
    $db_admin_pass,
    $pdns_hosts,
    $rabbit_user,
    $rabbit_pass,
    $keystone_public_port,
    $keystone_auth_port,
    $region,
    $puppet_git_repo_name,
    $puppet_git_repo_user,
    ) {

    $keystone_public_uri = "http://${keystone_api_fqdn}:${keystone_public_port}"
    $keystone_admin_uri = "http://${keystone_api_fqdn}:${keystone_auth_port}"
    $designate_host_ips = $designate_hosts.map |$host| { ipresolve($host, 4) }
    $puppetmaster_hostname_ip = ipresolve($puppetmaster_hostname,4)

    class { "openstack::designate::service::${version}": }

    file { '/usr/lib/python2.7/dist-packages/wmf_sink':
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        source  => "puppet:///modules/openstack/${version}/designate/wmf_sink",
        recurse => true,
    }

    file { '/usr/lib/python2.7/dist-packages/wmf_sink.egg-info':
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        source  => "puppet:///modules/openstack/${version}/designate/wmf_sink.egg-info",
        recurse => true,
    }

    file { '/usr/lib/python2.7/dist-packages/nova_fixed_multi':
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        source  => "puppet:///modules/openstack/${version}/designate/nova_fixed_multi",
        recurse => true,
    }

    file { '/usr/lib/python2.7/dist-packages/nova_fixed_multi.egg-info':
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        source  => "puppet:///modules/openstack/${version}/designate/nova_fixed_multi.egg-info",
        recurse => true,
    }

    file { '/usr/lib/python3/dist-packages/wmf_sink':
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        source  => "puppet:///modules/openstack/${version}/designate/wmf_sink",
        recurse => true,
    }

    file { '/usr/lib/python3/dist-packages/wmf_sink.egg-info':
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        source  => "puppet:///modules/openstack/${version}/designate/wmf_sink.egg-info",
        recurse => true,
    }

    file { '/usr/lib/python3/dist-packages/nova_fixed_multi':
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        source  => "puppet:///modules/openstack/${version}/designate/nova_fixed_multi",
        recurse => true,
    }

    file { '/usr/lib/python3/dist-packages/nova_fixed_multi.egg-info':
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        source  => "puppet:///modules/openstack/${version}/designate/nova_fixed_multi.egg-info",
        recurse => true,
    }

    # Stage pools.yaml.  Updating this file won't change active config;
    #  for that a user will need to manually run
    #
    #  $ sudo designate-manage pool update
    #
    file { '/etc/designate/pools.yaml':
        owner     => 'designate',
        group     => 'designate',
        mode      => '0440',
        show_diff => false,
        content   => template("openstack/${version}/designate/pools.yaml.erb"),
        require   => Package['designate-common'];
    }

    # We'll need this key to push to the instance-puppet repo
    $puppet_git_repo_key_path = '/var/lib/designate/.ssh/instance-puppet-user.priv'

    file {
        '/etc/designate/designate.conf':
            owner     => 'designate',
            group     => 'designate',
            mode      => '0440',
            show_diff => false,
            content   => template("openstack/${version}/designate/designate.conf.erb"),
            notify    => Service[
              'designate-api',
              'designate-sink',
              'designate-central',
              'designate-mdns',
              'designate-producer',
              'designate-worker'],
            require   => Package['designate-common'];
        '/etc/designate/api-paste.ini':
            content => template("openstack/${version}/designate/api-paste.ini.erb"),
            owner   => 'designate',
            group   => 'designate',
            notify  => Service['designate-api','designate-sink','designate-central'],
            require => Package['designate-api'],
            mode    => '0440';
        '/etc/designate/policy.json':
            ensure  => 'absent';
        '/etc/designate/policy.yaml':
            source  => "puppet:///modules/openstack/${version}/designate/policy.yaml",
            owner   => 'designate',
            group   => 'designate',
            notify  => Service['designate-api','designate-sink','designate-central'],
            require => Package['designate-common'],
            mode    => '0440';
        '/etc/designate/rootwrap.conf':
            source  => "puppet:///modules/openstack/${version}/designate/rootwrap.conf",
            owner   => 'root',
            group   => 'root',
            notify  => Service['designate-api','designate-sink','designate-central'],
            require => Package['designate-common'],
            mode    => '0440';
    }

    # Designate logrotate configurations were messed up for a long time
    # late Liberty versions fix this but this logrotate setup here should
    # ensure consistent state (T186142).  Absented things here can be removed
    # at a later date esp post Liberty.
    logrotate::conf { 'designate-common':
        ensure => 'present',
        source => 'puppet:///modules/openstack/designate/designate-common.logrotate',
    }

    file {'/etc/logrotate.d/designate-api':
        ensure => 'absent',
    }

    file {'/etc/logrotate.d/designate-central':
        ensure => 'absent',
    }

    file {'/etc/logrotate.d/designate-sink':
        ensure => 'absent',
    }

    file {'/etc/logrotate.d/designate-mdns':
        ensure => 'absent',
    }

    file {'/etc/logrotate.d/designate-pool-manager':
        ensure => 'absent',
    }

    file { '/var/lib/designate/.ssh/':
        ensure => 'directory',
        owner  => 'designate',
        group  => 'designate',
    }

    file { '/var/lib/designate/.ssh/id_rsa':
        owner     => 'designate',
        group     => 'designate',
        mode      => '0400',
        content   => secret('ssh/puppet_cert_manager/cert_manager'),
        show_diff => false,
    }

    # include rootwrap.d entries

    service {'designate-api':
        ensure  => $active,
        require => Package['designate-api'];
    }

    service {'designate-sink':
        ensure  => $active,
        require => Package['designate-sink'];
    }

    service {'designate-central':
        ensure  => $active,
        require => Package['designate-central'];
    }

    service {'designate-mdns':
        ensure  => $active,
        require =>  [
            Package['designate'],
        ],
    }

    service {'designate-pool-manager':
        ensure  => stopped,
    }

    service {'designate-zone-manager':
        ensure  => stopped,
    }

    $systemd_ensure = $active ? {
        true => 'present',
        default => 'absent',
    }

    # The Newton designate packages don't include service defs for
    #  the -worker or -producer services.  Hopefully we can replace these
    #  with simple service defines in O.
    systemd::service { 'designate-producer':
        ensure  => $systemd_ensure,
        content => systemd_template('designate-producer'),
        restart => true,
        require =>  [
            Package['designate'],
        ],
    }

    systemd::service { 'designate-worker':
        ensure  => $systemd_ensure,
        content => systemd_template('designate-worker'),
        restart => true,
        require =>  [
            Package['designate'],
        ],
    }

    # Get ready to host a local git repo of instance puppet config
    file { $puppet_git_repo_key_path:
        ensure    => file,
        owner     => 'designate',
        group     => 'designate',
        mode      => '0600',
        content   => secret('ssh/instance-puppet-user/instance-puppet-user_privkey.pem'),
        show_diff => false,
    }
}