Create a gist now

Instantly share code, notes, and snippets.

Puppet class recipe to install Node.JS & ZeroMQ on Ubuntu 10.04 LTS / Lucid
class nodejs {
Package { ensure => "installed" }
$pkglist = [ "python-software-properties" ]
package { $pkglist: }
$apt-base = "/etc/sources.list.d/chris-lea"
Exec { require => package["python-software-properties"] }
exec { "node-repo" :
command => "/usr/bin/add-apt-repository ppa:chris-lea/node.js",
creates => "${apt-base}/node.js-lucid.list",
}
exec { "zeromq-repo" :
command => "/usr/bin/add-apt-repository ppa:chris-lea/zeromq",
creates => "${apt-base}/zeromq-lucid.list",
}
exec { "libpgm-repo" :
command => "/usr/bin/add-apt-repository ppa:chris-lea/libpgm",
creates => "${apt-base}/libpgm-lucid.list"
}
$required-execs = [ "node-repo", "zeromq-repo", "libpgm-repo" ]
exec { "apt-ready" :
command => "/usr/bin/apt-get update",
require => Exec[$required-execs]
}
package { [ "nodejs", "nodejs-dev", "libzmq-dev" ] :
require => Exec["apt-ready"]
}
}
@garthk

Thanks!

Notes to help others running 10.04:

  • Try $apt-base = "/etc/apt/sources.list.d/chris-lea", which matched my fresh 10.04 clone.
  • In node-repo, try creates => "${apt-base}-node.js-lucid.list" to add it only if it's not there.
  • Use my fork if you're not big on editing.
  • Use the puppet-chrislea module Nial inspired if you want something module shaped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment