Puppet Class: labs_lvm

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

Overview

Parameters:

  • disk (Any) (defaults to: '/dev/vda')


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

class labs_lvm($disk = '/dev/vda') {

    package { ['lvm2', 'parted']:
        ensure => present,
    }

    file { '/usr/local/sbin/make-instance-vg':
        ensure  => file,
        source  => 'puppet:///modules/labs_lvm/make-instance-vg',
        require => Package['lvm2', 'parted'],
        mode    => '0544',
        owner   => 'root',
        group   => 'root',
    }


    file { '/usr/local/sbin/make-instance-vol':
        ensure  => file,
        source  => 'puppet:///modules/labs_lvm/make-instance-vol',
        require => Package['lvm2'],
        mode    => '0544',
        owner   => 'root',
        group   => 'root',
    }

    file { '/usr/local/sbin/extend-instance-vol':
        ensure  => file,
        source  => 'puppet:///modules/labs_lvm/extend-instance-vol',
        require => Package['lvm2'],
        mode    => '0544',
        owner   => 'root',
        group   => 'root',
    }

    exec { 'create-volume-group':
        logoutput => 'on_failure',
        unless    => '/sbin/vgdisplay -c vd',
        require   => File['/usr/local/sbin/make-instance-vg'],
        command   => "/usr/local/sbin/make-instance-vg '${disk}'",
    }

}