Puppet Class: ceph::config

Defined in:
modules/ceph/manifests/config.pp

Overview

Class: ceph::config

This class manages the Ceph common packages and configuration

Parameters

- $mon_hosts
    Hash that defines the ceph monitor host's public and private IPv4 information
- $fsid
    Ceph filesystem ID
- $enable_v2_messenger
    Enables Ceph messenger version 2 ( >= Nautilus release)
- $enable_libvirt_rbd
    Configure Ceph for libvirt based RBD clients
    Currently requires openstack::nova::compute::service::ocata::stretch
- $osd_hosts [Optional]
    Hash that defines the ceph object storage hosts, and public and private IPv4 information

Parameters:

  • enable_libvirt_rbd (Boolean)
  • enable_v2_messenger (Boolean)
  • mon_hosts (Hash[String,Hash])
  • cluster_network (Stdlib::IP::Address)
  • public_network (Stdlib::IP::Address)
  • fsid (String)
  • osd_hosts (Optional[Hash[String,Hash]]) (defaults to: {})


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
# File 'modules/ceph/manifests/config.pp', line 18

class ceph::config (
    Boolean                     $enable_libvirt_rbd,
    Boolean                     $enable_v2_messenger,
    Hash[String,Hash]           $mon_hosts,
    Stdlib::IP::Address         $cluster_network,
    Stdlib::IP::Address         $public_network,
    String                      $fsid,
    Optional[Hash[String,Hash]] $osd_hosts = {},
) {

    Class['ceph::common'] -> Class['ceph::config']

    # Ceph configuration file used for all services and clients
    file { '/etc/ceph/ceph.conf':
        ensure  => present,
        mode    => '0444',
        owner   => 'root',
        group   => 'root',
        content => template('ceph/ceph.conf.erb'),
        require => Package['ceph-common'],
    }

    if $enable_libvirt_rbd {
        package { 'python-rbd':
            ensure => present,
        }
        # Enable rbd support in qemu
        package { 'qemu-block-extra':
            ensure  => present,
        }

        # This directory contains qemu guest logs
        file { '/var/log/ceph/qemu':
            ensure => directory,
            mode   => '0755',
            owner  => 'libvirt-qemu',
            group  => 'libvirt-qemu',
        }

        # Allow libvirt-qemu to access the Ceph admin socket
        File<|title == '/var/run/ceph'|> {
            group  => 'libvirt-qemu',
        }

        file { '/var/run/ceph/guests':
            ensure => directory,
            mode   => '0770',
            owner  => 'ceph',
            group  => 'libvirt-qemu',
        }
    }
}