-
-
Save garthk/2246574 to your computer and use it in GitHub Desktop.
Puppet class recipe to install Node.JS on Ubuntu 10.04 LTS / Lucid
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
# Original recipe by niallo: https://gist.github.com/2003430 | |
# Full Puppet module: https://github.com/garthk/puppet-chrislea | |
# | |
# Adjustments: | |
# * Fixed operation on Ubuntu with sources.list.d in /etc/apt | |
# * Fixed operation on Ubuntu with current add-apt-repository entry filenames | |
# * Broke out chrislea definition for repository creation | |
# * Set timeout=3600 for apt-get, which can be slow | |
# * Avoided apt-get update if it's been done once since add-apt-repository | |
# * Broke out zeromq | |
# * Added g++, libexpat1-dev to nodejs | |
class python_software_properties { | |
$package = "python-software-properties" | |
package { $package: | |
ensure => installed, | |
} | |
} | |
define chrislea() { | |
include python_software_properties | |
exec { "chrislea-repo-added-${name}" : | |
command => "/usr/bin/add-apt-repository ppa:chris-lea/${name}", | |
creates => "/etc/apt/sources.list.d/chris-lea-${name}-${lsbdistcodename}.list", | |
require => Package[$::python_software_properties::package], | |
} | |
exec { "chrislea-repo-ready-${name}" : | |
command => "/usr/bin/apt-get update", | |
require => Exec["chrislea-repo-added-${name}"], | |
creates => "/var/lib/apt/lists/ppa.launchpad.net_chris-lea_${name}_ubuntu_dists_${lsbdistcodename}_Release", | |
timeout => 3600, | |
} | |
} | |
class nodejs { | |
chrislea { 'node.js': } | |
package { ["nodejs", "nodejs-dev", "npm"]: | |
ensure => installed, | |
require => Chrislea['node.js'], | |
} | |
# other packages we need, e.g. g++ to compile node-expat | |
package { ["g++", "libexpat1-dev"]: | |
ensure => installed, | |
} | |
} | |
class zeromq { | |
chrislea { 'zeromq': } | |
package { 'libzmq-dev': | |
ensure => installed, | |
require => Chrislea['zeromq'], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
… or, just use puppet-chrislea instead. I've turned it into a Puppet module.