Puppet Class: labstore::drbd::node

Defined in:
modules/labstore/manifests/drbd/node.pp

Overview

Parameters:

  • protocol (Any) (defaults to: 'B')
  • sync_rate (Any) (defaults to: '300M')


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
# File 'modules/labstore/manifests/drbd/node.pp', line 10

class labstore::drbd::node (
    $protocol = 'B',
    $sync_rate = '300M',
) {

    package {'drbd8-utils':
      ensure => present,
    }

    file {'/etc/drbd.conf':
        ensure => present,
        source => 'puppet:///modules/labstore/drbd.conf',
    }

    file {'/etc/drbd.d':
        ensure  => directory,
        purge   => true,
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        require => File['/etc/drbd.conf'],
    }

    # Setup global config that is shared for all DRBD resources on this node
    file { '/etc/drbd.d/global_common.conf':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        content => template('labstore/drbd/global_common.conf.erb'),
    }

    # When the global config is modified, this exec reconfigures them without
    # requiring service restart.
    exec { 'drbdadm-adjust':
        command     => '/sbin/drbdadm adjust all -v',
        onlyif      => '/bin/ls /etc/drbd.d/*.res',
        logoutput   => true,
        refreshonly => true,
        subscribe   => File['/etc/drbd.d/global_common.conf'],
    }
}