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
|
# File 'manifests/init.pp', line 20
class phantomjs (
String $version = '2.1.1',
Optional[String] $source_url = undef,
Stdlib::Absolutepath $path = '/usr/local/bin/phantomjs',
Array $package_dependencies = ['bzip2','fontconfig'],
) {
$package_dependencies_defaults = {
'before' => Archive['/tmp/phantomjs.tar.bz2']
}
ensure_packages($package_dependencies, $package_dependencies_defaults)
$source = pick($source_url, "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${version}-linux-x86_64.tar.bz2")
archive { '/tmp/phantomjs.tar.bz2':
source => $source,
extract => true,
extract_path => '/usr/local/src',
creates => "/usr/local/src/phantomjs-${version}-linux-x86_64",
cleanup => true,
user => 'root',
group => 'root',
}
-> file { 'phantomjs':
ensure => 'file',
path => $path,
owner => 'root',
group => 'root',
mode => '0755',
source => "/usr/local/src/phantomjs-${version}-linux-x86_64/bin/phantomjs"
}
}
|