Puppet Class: profile::openstack::base::puppetmaster::common

Defined in:
modules/profile/manifests/openstack/base/puppetmaster/common.pp

Overview

Parameters:

  • openstack_controllers (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::puppetmaster::common::openstack_controllers'))
  • designate_hosts (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::puppetmaster::common::designate_hosts'))
  • puppetmaster_webhostname (Any) (defaults to: hiera('profile::openstack::base::puppetmaster::web_hostname'))
  • puppetmaster_hostname (Any) (defaults to: hiera('profile::openstack::base::puppetmaster::common::puppetmaster_hostname'))
  • puppetmasters (Any) (defaults to: hiera('profile::openstack::base::puppetmaster::common::puppetmasters'))
  • encapi_db_host (Any) (defaults to: hiera('profile::openstack::base::puppetmaster::common::encapi_db_host'))
  • encapi_db_name (Any) (defaults to: hiera('profile::openstack::base::puppetmaster::common::encapi_db_name'))
  • encapi_db_user (Any) (defaults to: hiera('profile::openstack::base::puppetmaster::common::encapi_db_user'))
  • encapi_db_pass (Any) (defaults to: hiera('profile::openstack::base::puppetmaster::common::encapi_db_pass'))
  • encapi_statsd_prefix (Any) (defaults to: hiera('profile::openstack::base::puppetmaster::common::encapi_statsd_prefix'))
  • statsd_host (Any) (defaults to: hiera('profile::openstack::base::puppetmaster::common::statsd_host'))
  • labweb_hosts (Any) (defaults to: hiera('profile::openstack::base::labweb_hosts'))


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
# File 'modules/profile/manifests/openstack/base/puppetmaster/common.pp', line 1

class profile::openstack::base::puppetmaster::common(
    Array[Stdlib::Fqdn] $openstack_controllers = lookup('profile::openstack::base::puppetmaster::common::openstack_controllers'),
    Array[Stdlib::Fqdn] $designate_hosts = lookup('profile::openstack::base::puppetmaster::common::designate_hosts'),
    $puppetmaster_webhostname = hiera('profile::openstack::base::puppetmaster::web_hostname'),
    $puppetmaster_hostname = hiera('profile::openstack::base::puppetmaster::common::puppetmaster_hostname'),
    $puppetmasters = hiera('profile::openstack::base::puppetmaster::common::puppetmasters'),
    $encapi_db_host = hiera('profile::openstack::base::puppetmaster::common::encapi_db_host'),
    $encapi_db_name = hiera('profile::openstack::base::puppetmaster::common::encapi_db_name'),
    $encapi_db_user = hiera('profile::openstack::base::puppetmaster::common::encapi_db_user'),
    $encapi_db_pass = hiera('profile::openstack::base::puppetmaster::common::encapi_db_pass'),
    $encapi_statsd_prefix = hiera('profile::openstack::base::puppetmaster::common::encapi_statsd_prefix'),
    $statsd_host = hiera('profile::openstack::base::puppetmaster::common::statsd_host'),
    $labweb_hosts = hiera('profile::openstack::base::labweb_hosts'),
    ) {

    # array of puppetmasters
    $all_puppetmasters = inline_template('<%= @puppetmasters.values.flatten(1).map { |p| p[\'worker\'] }.sort.join(\' \')%>')

    class {'::puppetmaster::labsrootpass':}

    class {'::openstack::puppet::master::enc':
        puppetmaster => $puppetmaster_webhostname,
    }

    $labs_networks = join($network::constants::labs_networks, ' ')
    class { '::openstack::puppet::master::encapi':
        mysql_host            => $encapi_db_host,
        mysql_db              => $encapi_db_name,
        mysql_username        => $encapi_db_user,
        mysql_password        => $encapi_db_pass,
        statsd_host           => $statsd_host,
        statsd_prefix         => $encapi_statsd_prefix,
        puppetmasters         => $puppetmasters,
        labweb_hosts          => $labweb_hosts,
        openstack_controllers => $openstack_controllers,
        designate_hosts       => $designate_hosts,
    }

    # Update labs/private repo.
    class { 'puppetmaster::gitsync':
        run_every_minutes => '1',
    }

    $labweb_ips = inline_template("@resolve((<%= @labweb_hosts.join(' ') %>))")
    $labweb_aaaa = inline_template("@resolve((<%= @labweb_hosts.join(' ') %>), AAAA)")

    ferm::rule{'puppetmaster':
        ensure => 'present',
        rule   => "saddr (${labs_networks}
                          @resolve((${all_puppetmasters}))
                          @resolve((${join($labweb_hosts,' ')}))
                          @resolve((${join($labweb_hosts,' ')}), AAAA))
                          proto tcp dport 8141 ACCEPT;",
    }

    ferm::rule{'puppetbackend':
        ensure => 'present',
        rule   => "saddr (@resolve((${join($designate_hosts,' ')}))
                          @resolve((${join($designate_hosts,' ')}), AAAA)
                          @resolve((${join($labweb_hosts,' ')}))
                          @resolve((${join($labweb_hosts,' ')}), AAAA)
                          @resolve((${join($openstack_controllers,' ')}))
                          @resolve((${join($openstack_controllers,' ')}), AAAA))
                          proto tcp dport 8101 ACCEPT;",
    }

    ferm::rule{'puppetbackendgetter':
        ensure => 'present',
        rule   => "saddr (${labs_networks}
                          @resolve((${join($labweb_hosts,' ')}))
                          @resolve((${join($labweb_hosts,' ')}), AAAA)
                          @resolve((${all_puppetmasters})) @resolve((${all_puppetmasters}), AAAA))
                          proto tcp dport 8100 ACCEPT;",
    }
}