Puppet Class: profile::ceph::mon

Defined in:
modules/profile/manifests/ceph/mon.pp

Overview

Class: profile::ceph::mon

This profile configures Ceph monitor hosts with the mon and mgr daemons

Parameters:

  • prometheus_nodes (Array[Stdlib::Fqdn]) (defaults to: lookup('prometheus_nodes'))
  • mon_hosts (Hash[String,Hash]) (defaults to: lookup('profile::ceph::mon::hosts'))
  • osd_hosts (Hash[String,Hash]) (defaults to: lookup('profile::ceph::osd::hosts'))
  • admin_keyring (Stdlib::AbsolutePath) (defaults to: lookup('profile::ceph::admin_keyring'))
  • cluster_network (Stdlib::IP::Address) (defaults to: lookup('profile::ceph::cluster_network'))
  • public_network (Stdlib::IP::Address) (defaults to: lookup('profile::ceph::public_network'))
  • data_dir (Stdlib::Unixpath) (defaults to: lookup('profile::ceph::data_dir'))
  • admin_keydata (String) (defaults to: lookup('profile::ceph::admin_keydata'))
  • fsid (String) (defaults to: lookup('profile::ceph::fsid'))
  • mon_keydata (String) (defaults to: lookup('profile::ceph::mon::keydata'))


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
# File 'modules/profile/manifests/ceph/mon.pp', line 4

class profile::ceph::mon(
    Array[Stdlib::Fqdn]  $prometheus_nodes = lookup('prometheus_nodes'),
    Hash[String,Hash]    $mon_hosts        = lookup('profile::ceph::mon::hosts'),
    Hash[String,Hash]    $osd_hosts        = lookup('profile::ceph::osd::hosts'),
    Stdlib::AbsolutePath $admin_keyring    = lookup('profile::ceph::admin_keyring'),
    Stdlib::IP::Address  $cluster_network  = lookup('profile::ceph::cluster_network'),
    Stdlib::IP::Address  $public_network   = lookup('profile::ceph::public_network'),
    Stdlib::Unixpath     $data_dir         = lookup('profile::ceph::data_dir'),
    String               $admin_keydata    = lookup('profile::ceph::admin_keydata'),
    String               $fsid             = lookup('profile::ceph::fsid'),
    String               $mon_keydata      = lookup('profile::ceph::mon::keydata'),
) {
    include ::network::constants
    # Limit the client connections to the hypervisors in eqiad and codfw
    $client_networks = [
        $network::constants::all_network_subnets['production']['eqiad']['private']['labs-hosts1-b-eqiad']['ipv4'],
        $network::constants::all_network_subnets['production']['codfw']['private']['labs-hosts1-b-codfw']['ipv4'],
    ]

    $mon_addrs = $mon_hosts.map | $key, $value | { $value['public']['addr'] }
    $osd_addrs = $osd_hosts.map | $key, $value | { $value['public']['addr'] }

    $ferm_srange = join(concat($mon_addrs, $osd_addrs, $client_networks), ' ')
    ferm::service { 'ceph_mgr_v2':
        proto  => 'tcp',
        port   => 6800,
        srange => "(${ferm_srange})",
        before => Class['ceph::common'],
    }
    ferm::service { 'ceph_mgr_v1':
        proto  => 'tcp',
        port   => 6801,
        srange => "(${ferm_srange})",
        before => Class['ceph::common'],
    }
    ferm::service { 'ceph_mon_peers_v1':
        proto  => 'tcp',
        port   => 6789,
        srange => "(${ferm_srange})",
        before => Class['ceph::common'],
    }
    ferm::service { 'ceph_mon_peers_v2':
        proto  => 'tcp',
        port   => 3300,
        srange => "(${ferm_srange})",
        before => Class['ceph::common'],
    }

    if os_version('debian == buster') {
        apt::repository { 'thirdparty-ceph-nautilus-buster':
            uri        => 'http://apt.wikimedia.org/wikimedia',
            dist       => 'buster-wikimedia',
            components => 'thirdparty/ceph-nautilus-buster',
            source     => false,
            before     => Class['ceph::common'],
        }
    }

    class { 'ceph::common':
        home_dir => $data_dir,
    }

    class { 'ceph::config':
        cluster_network     => $cluster_network,
        enable_libvirt_rbd  => false,
        enable_v2_messenger => true,
        fsid                => $fsid,
        mon_hosts           => $mon_hosts,
        osd_hosts           => $osd_hosts,
        public_network      => $public_network,
    }

    class { 'ceph::admin':
        admin_keyring => $admin_keyring,
        admin_keydata => $admin_keydata,
        data_dir      => $data_dir,
    }

    Class['ceph::mon'] -> Class['ceph::mgr']
    class { 'ceph::mon':
        admin_keyring => $admin_keyring,
        data_dir      => $data_dir,
        fsid          => $fsid,
        mon_keydata   => $mon_keydata,
    }

    class { 'ceph::mgr':
        data_dir => $data_dir,
    }
}