Skip to content

Instantly share code, notes, and snippets.

@b4ldr
Created April 1, 2014 15:18
Show Gist options
  • Save b4ldr/9916288 to your computer and use it in GitHub Desktop.
Save b4ldr/9916288 to your computer and use it in GitHub Desktop.
class phantomjs::config {
require phantomjs::params
Exec { path => "/bin" }
file {"$phantomjs::params::phantomjs_base":
ensure => "directory",
owner => "root",
group => "root",
alias => "phantomjs-base"
}
file {"$phantomjs::params::phantomjs_bin":
ensure => "directory",
owner => "root",
group => "root",
alias => "phantomjs-bin"
}
file { "${phantomjs::params::phantomjs_base}/phantomjs-${phantomjs::params::phantomjs_version}-linux-x86_64.tar.bz2":
mode => 0644,
owner => root,
group => root,
source => "puppet:///modules/phantomjs/phantomjs-${phantomjs::params::phantomjs_version}-linux-x86_64.tar.bz2",
alias => "phantomjs-source-bz2",
before => Exec["untar-phantomjs"],
require => File["phantomjs-base"]
}
exec { "untar phantomjs-${phantomjs::params::phantomjs_version}-linux-x86_64.tar.bz2":
command => "tar -xvf phantomjs-${phantomjs::params::phantomjs_version}-linux-x86_64.tar.bz2",
cwd => "${phantomjs::params::phantomjs_base}",
creates => "${phantomjs::params::phantomjs_base}/phantomjs-${phantomjs::params::phantomjs_version}-linux-x86_64",
alias => "untar-phantomjs",
refreshonly => true,
subscribe => File["phantomjs-source-bz2"],
before => File["phantomjs-app-dir"]
}
file { "${phantomjs::params::phantomjs_base}/phantomjs-${phantomjs::params::phantomjs_version}-linux-x86_64":
ensure => "directory",
mode => 0644,
owner => root,
group => root,
alias => "phantomjs-app-dir"
}
file { "${phantomjs::params::phantomjs_bin}/phantomjs":
ensure => "link",
target => "${phantomjs::params::phantomjs_base}/phantomjs-${phantomjs::params::phantomjs_version}-linux-x86_64/bin/phantomjs",
owner => root,
group => root,
}
}
Info: Retrieving plugin
Info: Caching catalog for dev-app1.nba.internal
Info: Applying configuration version '1396364524'
Notice: /Stage[main]/Phantomjs::Config/File[/usr/local//phantomjs-1.9.7-linux-x86_64.tar.bz2]/ensure: defined content as '{md5}f278996c3edd0e8d8ec4893807f27d71'
Info: /Stage[main]/Phantomjs::Config/File[/usr/local//phantomjs-1.9.7-linux-x86_64.tar.bz2]: Scheduling refresh of Exec[untar phantomjs-1.9.7-linux-x86_64.tar.bz2]
Notice: /Stage[main]/Phantomjs::Config/Exec[untar phantomjs-1.9.7-linux-x86_64.tar.bz2]/returns: tar (child): bzip2: Cannot exec: No such file or directory
Notice: /Stage[main]/Phantomjs::Config/Exec[untar phantomjs-1.9.7-linux-x86_64.tar.bz2]/returns: tar (child): Error is not recoverable: exiting now
Notice: /Stage[main]/Phantomjs::Config/Exec[untar phantomjs-1.9.7-linux-x86_64.tar.bz2]/returns: tar: Child returned status 2
Notice: /Stage[main]/Phantomjs::Config/Exec[untar phantomjs-1.9.7-linux-x86_64.tar.bz2]/returns: tar: Error is not recoverable: exiting now
Error: /Stage[main]/Phantomjs::Config/Exec[untar phantomjs-1.9.7-linux-x86_64.tar.bz2]: Failed to call refresh: tar -xjvf phantomjs-1.9.7-linux-x86_64.tar.bz2 returned 2 instead of one of [0]
Error: /Stage[main]/Phantomjs::Config/Exec[untar phantomjs-1.9.7-linux-x86_64.tar.bz2]: tar -xjvf phantomjs-1.9.7-linux-x86_64.tar.bz2 returned 2 instead of one of [0]
Notice: /Stage[main]/Phantomjs::Config/File[/usr/local//phantomjs-1.9.7-linux-x86_64]/ensure: created
Notice: Finished catalog run in 8.93 seconds
class phantomjs::params {
$phantomjs_version = $::hostname ? {
default => "1.9.7",
}
$phantomjs_base = $::hostname ? {
default => "/usr/local/",
}
$phantomjs_bin = $::hostname ? {
default => "/usr/local/bin",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment