public
Created

Puppet class recipe to install Node.JS & ZeroMQ on Ubuntu 10.04 LTS / Lucid

  • Download Gist
ubuntu-lucid-node-zeromq
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
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"]
}
}

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.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.