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

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

Overview

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_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'))
  • 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'))


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

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'),
    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              $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_network     => $cluster_network,
        enable_libvirt_rbd  => true,
        enable_v2_messenger => $enable_v2_messenger,
        fsid                => $fsid,
        mon_hosts           => $mon_hosts,
        public_network      => $public_network,
    }

    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,
    }

    # TODO: cleanup old files
    file { '/etc/ceph/libvirt-cinder-secret.xml':
        ensure => absent,
    }
    file { '/etc/ceph/libvirt-secret.xml':
        ensure => absent,
    }

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