Created
April 14, 2013 15:15
-
-
Save mathie/5383077 to your computer and use it in GitHub Desktop.
Puppet class for installing phantomjs. An example of using curl to grab a tarball for installation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class phantomjs { | |
include xvfb | |
$version = '1.8.1' | |
$basename = "phantomjs-${version}-linux-x86_64" | |
$tarball = "${basename}.tar.bz2" | |
$tarball_path = "/opt/${tarball}" | |
$url = "http://phantomjs.googlecode.com/files/${tarball}" | |
$destdir = "/opt/${basename}" | |
package { | |
'phantomjs': | |
ensure => absent; | |
} | |
exec { | |
'download-phantomjs-binary': | |
command => "/usr/bin/curl -L -o ${tarball_path} ${url}", | |
creates => $tarball_path; | |
'unpack-phantomjs-binary': | |
command => "/bin/tar jxf ${tarball_path}", | |
cwd => '/opt', | |
creates => $destdir, | |
require => Exec['download-phantomjs-binary']; | |
} | |
file { | |
'/usr/local/bin/phantomjs': | |
ensure => link, | |
target => "${destdir}/bin/phantomjs", | |
require => Exec['unpack-phantomjs-binary']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment