Puppet Class: ganeti

Defined in:
modules/ganeti/manifests/init.pp

Overview

Class ganeti

Install ganeti

Parameters:

with_drbd: Boolean. Indicates if drbd should be configured. Defaults to true

Actions:

Install ganeti and configure modules/LVM. Does NOT initialize a cluster

Requires:

Sample Usage

include ganeti

Parameters:

  • with_drbd (Any) (defaults to: true)


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
# File 'modules/ganeti/manifests/init.pp', line 15

class ganeti(
    $with_drbd=true
    ) {
    include ::ganeti::kvm

    # We're not using ganeti-instance-debootstrap to create images (we PXE-boot
    # the same images we use for baremetal servers), but /usr/share/ganeti/os/debootstrap
    # is needed as an OS provider for "gnt-instance add"
    package { [
            'ganeti',
            'drbd-utils',
            'ovmf',
            'ganeti-instance-debootstrap',
            ] :
        ensure => installed,
    }

    if $with_drbd {
        kmod::options { 'drbd':
            options => 'minor_count=128 usermode_helper=/bin/true',
        }

        # Enable drbd
        kmod::module { 'drbd':
            ensure => 'present',
        }

        # Disable the systemd service shipped with the drbd package. Ganeti handles
        # DRBD on its own
        service { 'drbd':
            ensure => 'stopped',
            enable => false,
        }
    }

    # Enable vhost_net
    kmod::module { 'vhost_net':
        ensure => 'present',
    }

    # lvm.conf
    # Note: We deviate from the default lvm.conf to change the filter config to
    # not include all block devices. TODO: Do it via augeas
    file { '/etc/lvm/lvm.conf' :
        ensure => present,
        owner  => 'root',
        group  => 'root',
        mode   => '0644',
        source => 'puppet:///modules/ganeti/lvm.conf',
    }

    # Deploy defaults (for now, configuring RAPI) and the certificates for RAPI.
    # Potential fixme: We don't restart the daemon here since it's not independent
    # and this file configures other aspects of Ganeti. Manually restart ganeti
    # on the target hosts after changes are merged.
    $certname = "ganeti01.svc.${::site}.wmnet"
    file { '/etc/default/ganeti':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        content => template('ganeti/etc_default_ganeti.erb')
    }
    sslcert::certificate { $certname:
        ensure     => present,
        group      => 'gnt-admin',
        use_cergen => true,
    }
}