From e5650c49d0fcc32218c70628b73ca5b3bca7b751 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 31 Oct 2017 17:54:44 -0200 Subject: Initial nodejs management --- manifests/init.pp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index d2b5f4c..f5d5f32 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,2 +1,30 @@ +# See https://linuxconfig.org/how-to-install-nodejs-on-debian-9-stretch-linux class nodejs { + file { '/etc/apt/trusted.gpg.d/nodesource.gpg': + ensure => present, + mode => '0644', + user => 'root', + group => 'root', + source => 'file:///puppet/modules/nodejs/nodesource.gpg', + } + + file { '/usr/local/sbin/setup-nodejs-6.x': + ensure => present, + mode => '0755', + user => 'root', + group => 'root', + source => 'file:///puppet/modules/nodejs/setup_6.x.sh', + } + + exec { 'setup-nodejs-6.x': + command => "", + user => "root", + creates => '/etc/apt/sources.list.d/nodesource.list', + require => File['/etc/apt/trusted.gpg.d/nodesource.gpg', '/usr/local/sbin/setup-nodejs-6.x' ], + } + + package { [ 'nodejs', 'build-essential', 'libssl-dev' ]: + ensure => present, + require => Exec['setup-nodejs-6.x'], + } } -- cgit v1.2.3