Puppet Class: profile::ceph::client::rbd

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

Overview

Class: profile::ceph::client:rbd

This profile will configure clients for connecting to Ceph rados block storage using the native kernel driver or librbd

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'))
  • 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'))
  • fsid (String) (defaults to: lookup('profile::ceph::fsid'))
  • keydata (String) (defaults to: lookup('profile::ceph::client::rbd::keydata'))
  • keyfile_group (String) (defaults to: lookup('profile::ceph::client::rbd::keyfile_group'))
  • keyfile_owner (String) (defaults to: lookup('profile::ceph::client::rbd::keyfile_owner'))


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

class profile::ceph::client::rbd(
    Boolean             $enable_v2_messenger = lookup('profile::ceph::client::rbd::enable_v2_messenger'),
    Hash[String,Hash]   $mon_hosts           = lookup('profile::ceph::mon::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              $fsid                = lookup('profile::ceph::fsid'),
    String              $keydata             = lookup('profile::ceph::client::rbd::keydata'),
    String              $keyfile_group       = lookup('profile::ceph::client::rbd::keyfile_group'),
    String              $keyfile_owner       = lookup('profile::ceph::client::rbd::keyfile_owner'),
) {

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

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

    # The keydata used in this step is pre-created on one of the ceph mon hosts
    # typically with the 'ceph auth get-or-create' command
    file { "/etc/ceph/ceph.client.${client_name}.keyring":
        ensure    => present,
        mode      => '0440',
        owner     => $keyfile_owner,
        group     => $keyfile_group,
        content   => "[client.${client_name}]\n        key = ${keydata}\n",
        show_diff => false,
        require   => Package['ceph-common'],
    }
}