Puppet Class: profile::openstack::codfw1dev::pdns::auth::service

Defined in:
modules/profile/manifests/openstack/codfw1dev/pdns/auth/service.pp

Overview

Parameters:

  • hosts (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::codfw1dev::pdns::hosts'))
  • db_pass (Any) (defaults to: hiera('profile::openstack::codfw1dev::pdns::db_pass'))
  • pdns_api_key (String) (defaults to: lookup('profile::openstack::codfw1dev::pdns::api_key'))


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
# File 'modules/profile/manifests/openstack/codfw1dev/pdns/auth/service.pp', line 1

class profile::openstack::codfw1dev::pdns::auth::service(
    Array[Stdlib::Fqdn] $hosts = lookup('profile::openstack::codfw1dev::pdns::hosts'),
    $db_pass = hiera('profile::openstack::codfw1dev::pdns::db_pass'),
    String $pdns_api_key = lookup('profile::openstack::codfw1dev::pdns::api_key'),
    ) {

    # This iterates on $hosts and returns the entry in $hosts with the same
    #  ipv4 as $::fqdn
    $service_fqdn = $hosts.reduce(false) |$memo, $service_host_fqdn| {
        if (ipresolve($::fqdn,4) == ipresolve($service_host_fqdn,4)) {
            $rval = $service_host_fqdn
        } else {
            $rval = $memo
        }
        $rval
    }

    # We're patching in our ipv4 address for db_host here;
    #  for unclear reasons 'localhost' doesn't work properly
    #  with the version of Mariadb installed on Jessie.
    class {'::profile::openstack::base::pdns::auth::service':
        hosts               => $hosts,
        service_fqdn        => $service_fqdn,
        db_pass             => $db_pass,
        db_host             => ipresolve($::fqdn,4),
        pdns_webserver      => true,
        pdns_api_key        => $pdns_api_key,
        pdns_api_allow_from => flatten(['127.0.0.1', $hosts.map |$host| { ipresolve($host, 4) },
                                $hosts.map |$host| { ipresolve($host, 6) }])
    }

    class {'::profile::openstack::base::pdns::auth::monitor::pdns_control':}
}