Puppet Class: role::mwdumper

Defined in:
puppet/modules/role/manifests/mwdumper.pp

Overview

Class: role::mwdumper

Install the mwdumper command line tool for importing MediaWiki dumps.

[1]: www.mediawiki.org/wiki/Manual:MWDumper



7
8
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
# File 'puppet/modules/role/manifests/mwdumper.pp', line 7

class role::mwdumper {
    require ::role::mediawiki

    require_package(['maven', 'default-jdk'])

    $mwdumper_dir = "${::mwv::services_dir}/mwdumper"
    $mwdumper_file = "${mwdumper_dir}/target/mwdumper-1.25.jar"

    git::clone { 'mediawiki/tools/mwdumper':
        # not really a service but close enough...
        directory => $mwdumper_dir,
    }

    exec { 'compile MWDumper':
        # see https://stackoverflow.com/a/53085816/323407 for the _JAVA_OPTIONS hack
        # needed as of 2019-01; should be removed once unnecessary
        command => 'mvn compile; _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true mvn package',
        creates => $mwdumper_file,
        cwd     => $mwdumper_dir,
        require => [
            Package['maven', 'default-jdk'],
            Git::Clone['mediawiki/tools/mwdumper'],
        ],
    }

    file { '/usr/local/bin/mwdumper':
        ensure  => 'file',
        content => template('role/mwdumper/mwdumper.erb'),
        mode    => 'a+x',
    }

    mediawiki::import::text { 'VagrantRoleMwdumper':
        content => template('role/mwdumper/VagrantRoleMwdumper.wiki.erb'),
    }
}