Puppet Class: labs_vagrant

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

Overview

Class: labs_vagrant

Configure a labs host to use MediaWiki-Vagrant to manage local wikis

Parameters:

  • $install_directory: Directory to install MediaWiki-Vagrant in. Default /srv/vagrant

Parameters:

  • install_directory (Any) (defaults to: '/srv/vagrant')


9
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
65
66
67
68
69
70
71
# File 'modules/labs_vagrant/manifests/init.pp', line 9

class labs_vagrant(
    $install_directory = '/srv/vagrant',
) {

    $legacy_directory = '/mnt/vagrant'

    if $install_directory != $legacy_directory {
        exec { 'migrate legacy files':
            command => template('labs_vagrant/migrate_legacy.erb'),
            onlyif  => "/usr/bin/test -d ${legacy_directory}",
            before  => Git::Clone['vagrant'],
        }
    }

    file { '/home/vagrant':
        ensure => 'directory',
        owner  => 'vagrant',
        group  => 'vagrant',
    }

    sudo::user { 'vagrant' :
        privileges => [
            'ALL=(ALL) NOPASSWD: ALL',
        ],
    }

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

    git::clone { 'vagrant':
        directory => $install_directory,
        origin    => 'https://gerrit.wikimedia.org/r/mediawiki/vagrant',
        owner     => 'vagrant',
        group     => 'wikidev',
        shared    => true,
        branch    => 'master',
    }

    file { "${install_directory}/logs":
        ensure  => 'directory',
        owner   => 'vagrant',
        group   => 'www-data',
        mode    => '0775',
        require => Git::Clone['vagrant'],
    }

    file { '/vagrant':
        ensure  => 'link',
        target  => $install_directory,
        require => Git::Clone['vagrant'],
    }

    file { '/bin/labs-vagrant':
        ensure  => 'link',
        target  => '/vagrant/lib/labs-vagrant.rb',
        mode    => '0555',
        require => File['/vagrant'],
    }
}