Puppet Class: profile::ceph::client::rbd_libvirt

Defined in:
modules/profile/manifests/ceph/client/rbd_libvirt.pp

Overview

SPDX-License-Identifier: Apache-2.0 Class: profile::ceph::client:rbd_libvirt

This profile will configure clients for connecting to Ceph rados block storage using the native kernel driver or librbd. This includes some extras for integration with nova/libvirt/qemu

Parameters:

  • enable_v2_messenger (Boolean) (defaults to: lookup('profile::ceph::client::rbd::enable_v2_messenger'))
  • mon_hosts (Hash[String,Hash]) (defaults to: lookup('profile::ceph::mon::hosts'))
  • osd_hosts (Hash[String,Hash]) (defaults to: lookup('profile::ceph::osd::hosts'))
  • cluster_networks (Array[Stdlib::IP::Address]) (defaults to: lookup('profile::ceph::cluster_networks'))
  • public_networks (Array[Stdlib::IP::Address]) (defaults to: lookup('profile::ceph::public_networks'))
  • data_dir (Stdlib::Unixpath) (defaults to: lookup('profile::ceph::data_dir'))
  • client_name (String) (defaults to: lookup('profile::ceph::client::rbd::client_name'))
  • cinder_client_name (String) (defaults to: lookup('profile::ceph::client::rbd::cinder_client_name'))
  • fsid (String) (defaults to: lookup('profile::ceph::fsid'))
  • libvirt_rbd_uuid (String) (defaults to: lookup('profile::ceph::client::rbd::libvirt_rbd_uuid'))
  • libvirt_rbd_cinder_uuid (String) (defaults to: lookup('profile::ceph::client::rbd::libvirt_rbd_cinder_uuid'))
  • ceph_repository_component (String) (defaults to: lookup('profile::ceph::ceph_repository_component'))
  • ceph_auth_conf (Ceph::Auth::Conf) (defaults to: lookup('profile::ceph::auth::deploy::configuration'))


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

class profile::ceph::client::rbd_libvirt(
    Boolean                    $enable_v2_messenger       = lookup('profile::ceph::client::rbd::enable_v2_messenger'),
    Hash[String,Hash]          $mon_hosts                 = lookup('profile::ceph::mon::hosts'),
    Hash[String,Hash]          $osd_hosts                 = lookup('profile::ceph::osd::hosts'),
    Array[Stdlib::IP::Address] $cluster_networks          = lookup('profile::ceph::cluster_networks'),
    Array[Stdlib::IP::Address] $public_networks           = lookup('profile::ceph::public_networks'),
    Stdlib::Unixpath           $data_dir                  = lookup('profile::ceph::data_dir'),
    String                     $client_name               = lookup('profile::ceph::client::rbd::client_name'),
    String                     $cinder_client_name        = lookup('profile::ceph::client::rbd::cinder_client_name'),
    String                     $fsid                      = lookup('profile::ceph::fsid'),
    String                     $libvirt_rbd_uuid          = lookup('profile::ceph::client::rbd::libvirt_rbd_uuid'),
    String                     $libvirt_rbd_cinder_uuid   = lookup('profile::ceph::client::rbd::libvirt_rbd_cinder_uuid'),
    String                     $ceph_repository_component = lookup('profile::ceph::ceph_repository_component'),
    Ceph::Auth::Conf           $ceph_auth_conf            = lookup('profile::ceph::auth::deploy::configuration'),
) {

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

    class { 'ceph::config':
        cluster_networks    => $cluster_networks,
        enable_libvirt_rbd  => true,
        enable_v2_messenger => $enable_v2_messenger,
        fsid                => $fsid,
        mon_hosts           => $mon_hosts,
        public_networks     => $public_networks,
    }

    if ! $ceph_auth_conf[$client_name] {
        fail("missing '${client_name}' in ceph auth configuration")
    }
    if ! $ceph_auth_conf[$client_name]['keydata'] {
        fail("missing '${client_name}' keydata in ceph auth configuration")
    }

    openstack::nova::libvirt::secret { 'nova-compute':
        keydata      => $ceph_auth_conf[$client_name]['keydata'],
        client_name  => $client_name,
        libvirt_uuid => $libvirt_rbd_uuid,
    }

    if ! $ceph_auth_conf[$cinder_client_name] {
        fail("missing '${cinder_client_name}' in ceph auth configuration")
    }
    if ! $ceph_auth_conf[$cinder_client_name]['keydata'] {
        fail("missing '${cinder_client_name}' keydata in ceph auth configuration")
    }

    openstack::nova::libvirt::secret { 'nova-compute-cinder':
        keydata      => $ceph_auth_conf[$cinder_client_name]['keydata'],
        client_name  => $cinder_client_name,
        libvirt_uuid => $libvirt_rbd_cinder_uuid,
    }

    class { 'prometheus::node_pinger':
        nodes_to_ping => $osd_hosts.keys() + $mon_hosts.keys(),
    }
}