Puppet Class: vagrant

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

Overview

Class: vagrant

Provision Vagrant

Parameters:

vagrant_home

Directory where Vagrant stores global state. (default: '/srv/vagrant-data')

Parameters:

  • vagrant_home (Any) (defaults to: '/srv/vagrant-data')


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
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'modules/vagrant/manifests/init.pp', line 10

class vagrant(
    $vagrant_home = '/srv/vagrant-data',
) {
    package { 'vagrant':
        ensure => present,
    }

    user { 'mwvagrant':
        ensure => present,
        gid    => 'wikidev',
        home   => $vagrant_home,
    }

    file { $vagrant_home:
        ensure => 'directory',
        owner  => 'mwvagrant',
        group  => 'wikidev',
        mode   => '0755',
    }

    # Set umask and VAGRANT_HOME for mwvagrant user
    file { "${vagrant_home}/.profile":
        ensure  => present,
        content => template('vagrant/mwvagrant-profile.erb'),
        owner   => 'mwvagrant',
        group   => 'wikidev',
        mode    => '0744',
    }

    sudo::group { 'wikidev_mwvagrant':
        privileges => [
            'ALL=(mwvagrant) NOPASSWD: ALL',
        ],
        group      => 'wikidev',
    }

    # Wrapper script to make it easier to invoke vagrant in a shared
    # environment.
    file { '/usr/local/bin/mwvagrant':
        ensure  => 'present',
        content => template('vagrant/mwvagrant.erb'),
        owner   => 'root',
        group   => 'root',
        mode    => '0555',
    }

    # set umask for wikidev users so that newly-created files are g+w
    file { '/etc/profile.d/alias-vagrant.sh':
        ensure => present,
        owner  => 'root',
        group  => 'root',
        mode   => '0444',
        source => 'puppet:///modules/vagrant/alias-vagrant-profile-d.sh',
    }
}