Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@garthk
Forked from niallo/ubuntu-lucid-node-zeromq
Created March 30, 2012 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garthk/2246574 to your computer and use it in GitHub Desktop.
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
# 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'],
}
}
@garthk
Copy link
Author

garthk commented Mar 30, 2012

… or, just use puppet-chrislea instead. I've turned it into a Puppet module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment