Puppet Class: openstack::designate::service

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

Overview

Parameters:

  • active (Any)
  • version (Any)
  • designate_host (Any)
  • keystone_host (Any)
  • db_user (Any)
  • db_pass (Any)
  • db_host (Any)
  • db_name (Any)
  • domain_id_internal_forward (Any)
  • domain_id_internal_reverse (Any)
  • pool_manager_db_name (Any)
  • puppetmaster_hostname (Any)
  • nova_controller (Any)
  • ldap_user_pass (Any)
  • pdns_db_user (Any)
  • pdns_db_pass (Any)
  • pdns_db_name (Any)
  • db_admin_user (Any)
  • db_admin_pass (Any)
  • primary_pdns_ip (Any)
  • secondary_pdns_ip (Any)
  • rabbit_user (Any)
  • rabbit_pass (Any)
  • rabbit_host (Any)
  • keystone_public_port (Any)
  • keystone_auth_port (Any)
  • region (Any)
  • coordination_host (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
# File 'modules/openstack/manifests/designate/service.pp', line 4

class openstack::designate::service(
    $active,
    $version,
    $designate_host,
    $keystone_host,
    $db_user,
    $db_pass,
    $db_host,
    $db_name,
    $domain_id_internal_forward,
    $domain_id_internal_reverse,
    $pool_manager_db_name,
    $puppetmaster_hostname,
    $nova_controller,
    $ldap_user_pass,
    $pdns_db_user,
    $pdns_db_pass,
    $pdns_db_name,
    $db_admin_user,
    $db_admin_pass,
    $primary_pdns_ip,
    $secondary_pdns_ip,
    $rabbit_user,
    $rabbit_pass,
    $rabbit_host,
    $keystone_public_port,
    $keystone_auth_port,
    $region,
    $coordination_host,
    ) {

    $keystone_host_ip   = ipresolve($keystone_host,4)
    $nova_controller_ip = ipresolve($nova_controller)
    $keystone_public_uri = "http://${keystone_host}:${keystone_public_port}"
    $keystone_admin_uri = "http://${keystone_host}:${keystone_auth_port}"
    $designate_host_ip = ipresolve($designate_host,4)
    $puppetmaster_hostname_ip = ipresolve($puppetmaster_hostname,4)

    $packages = [
        'designate-sink',
        'designate-common',
        'designate',
        'designate-api',
        'designate-doc',
        'designate-central',
    ]

    if os_version('debian jessie') and ($version == 'mitaka') {
        $install_options = ['-t', 'jessie-backports']
    } else {
        $install_options = ''
    }

    package { $packages:
        ensure          => 'present',
        install_options => $install_options,
    }

    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 {
        '/etc/designate/designate.conf':
            owner   => 'designate',
            group   => 'designate',
            mode    => '0440',
            content => template("openstack/${version}/designate/designate.conf.erb"),
            notify  => Service['designate-api','designate-sink','designate-central','designate-mdns','designate-pool-manager'],
            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':
            source  => "puppet:///modules/openstack/${version}/designate/policy.json",
            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,
    }

    file {'/etc/init/designate-pool-manager.conf':
        ensure  => 'present',
        owner   => 'root',
        group   => 'root',
        mode    => '0544',
        content => template('openstack/initscripts/designate-pool-manager.upstart.erb'),
        notify  => Service['designate-pool-manager'],
    }

    file {'/etc/init/designate-mdns.conf':
        ensure  => 'present',
        owner   => 'root',
        group   => 'root',
        mode    => '0544',
        content => template('openstack/initscripts/designate-mdns.upstart.erb'),
        notify  => Service['designate-mdns'],
    }

    # 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'],
            File['/etc/init/designate-mdns.conf'],
        ],
    }

    service {'designate-pool-manager':
        ensure  => $active,
        require =>  [
            Package['designate'],
            File['/etc/init/designate-pool-manager.conf'],
        ],
    }
}