summaryrefslogtreecommitdiff
path: root/provisioning/modules
diff options
context:
space:
mode:
authorCaio Carrara <ccarrara@thoughtworks.com>2016-06-30 17:05:43 -0300
committerCaio Carrara <ccarrara@thoughtworks.com>2016-06-30 17:05:43 -0300
commit1b024b04a7e007b097853656dc5f7a54c5d4f53b (patch)
tree28ec12b5f76a4208192bdfba49def4eaafbdd670 /provisioning/modules
parentfdfab580079697d4c33a6862318416c91fb3f59c (diff)
Implement nodejs provisioning based on package mnaging
This change is based on official node instructions.
Diffstat (limited to 'provisioning/modules')
-rw-r--r--provisioning/modules/pixelated/manifests/apt.pp30
-rw-r--r--provisioning/modules/pixelated/manifests/source.pp2
2 files changed, 30 insertions, 2 deletions
diff --git a/provisioning/modules/pixelated/manifests/apt.pp b/provisioning/modules/pixelated/manifests/apt.pp
index 8cfd3983..bd44b86a 100644
--- a/provisioning/modules/pixelated/manifests/apt.pp
+++ b/provisioning/modules/pixelated/manifests/apt.pp
@@ -1,6 +1,12 @@
# add the pixelated sources needed to install everything
class pixelated::apt {
+ package { [
+ 'apt-transport-https',
+ 'lsb-release']:
+ ensure => installed
+ }
+
# jessie backports
file { '/etc/apt/sources.list.d/jessie-backports.list':
source => 'puppet:///modules/pixelated/apt/jessie-backports.list',
@@ -51,9 +57,33 @@ class pixelated::apt {
require => Exec['apt_get_update']
}
+ # nodejs latest repo
+ file { '/etc/apt/sources.list.d/noderesource.list':
+ content =>
+ 'deb https://deb.nodesource.com/node_6.x jessie main
+ deb-src https://deb.nodesource.com/node_6.x jessie main',
+ owner => 'root'
+ }
+ exec{'add_nodesource_key':
+ command => '/usr/bin/curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -',
+ notify => Exec['apt_get_update']
+ }
+ file { '/etc/apt/preferences.d/nodejs':
+ content =>
+ 'Package: nodejs
+ Pin: release o=Node Source
+ Pin-Priority: 999',
+ owner => 'root'
+ }
+
exec { 'apt_get_update':
command => '/usr/bin/apt-get -y update',
refreshonly => true,
+ require => [
+ Package['apt-transport-https', 'lsb-release'],
+ File['/etc/apt/sources.list.d/noderesource.list'],
+ File['/etc/apt/preferences.d/nodejs']
+ ]
}
}
diff --git a/provisioning/modules/pixelated/manifests/source.pp b/provisioning/modules/pixelated/manifests/source.pp
index 9529f761..67c51578 100644
--- a/provisioning/modules/pixelated/manifests/source.pp
+++ b/provisioning/modules/pixelated/manifests/source.pp
@@ -5,8 +5,6 @@ class pixelated::source {
package { [
'git',
'nodejs',
- 'nodejs-legacy',
- 'npm',
'python-dev',
'libffi-dev',
'libssl-dev',