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

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

Overview

Parameters:

  • host (Any) (defaults to: hiera('profile::openstack::main::pdns::host'))
  • host_secondary (Any) (defaults to: hiera('profile::openstack::main::pdns::host_secondary'))
  • db_pass (Any) (defaults to: hiera('profile::openstack::main::pdns::db_pass'))
  • monitor_target_fqdn (Any) (defaults to: hiera('profile::openstack::main::pdns::monitor_target_fqdn'))


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

class profile::openstack::main::pdns::auth::service(
    $host = hiera('profile::openstack::main::pdns::host'),
    $host_secondary = hiera('profile::openstack::main::pdns::host_secondary'),
    $db_pass = hiera('profile::openstack::main::pdns::db_pass'),
    $monitor_target_fqdn = hiera('profile::openstack::main::pdns::monitor_target_fqdn'),
    ) {

    $host_ip = ipresolve($host,4)
    $host_secondary_ip = ipresolve($host_secondary,4)

    class {'::profile::openstack::base::pdns::auth::service':
        host           => $host,
        host_secondary => $host_secondary,
        db_pass        => $db_pass,
    }

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

    # This could be handled with two profiles and should be
    #  if it becomes more complex than this bit of logic.
    # Also contingent on the host address resolving to the same
    #  IP as the public SOA record.
    if ($host_ip == $::ipaddress) {
        $auth_dns_host = $host
    }
    elsif ($host_secondary_ip == $::ipaddress) {
        $auth_dns_host = $host_secondary
    }
    else {
        # Valid auth DNS servers all resolve to the main
        #  server IP for now.
        fail("${::ipaddress} is not valid for ${name}")
    }

    class {'::profile::openstack::base::pdns::auth::monitor::host_check':
        target_host => $auth_dns_host,
        target_fqdn => $monitor_target_fqdn,
    }
}