diff --git a/manifests/init.pp b/manifests/init.pp index 38e871c3..9f76dcac 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -43,6 +43,10 @@ before => Anchor['nodejs::repo'], } } + + apt::ppa { 'ppa:chris-lea/node.js-devel': + before => Anchor['nodejs::repo'], + } } } @@ -86,10 +90,12 @@ require => Anchor['nodejs::repo'] } - package { 'npm': - name => $nodejs::params::npm_pkg, - ensure => present, - require => Anchor['nodejs::repo'] + if $::operatingsystem != 'ubuntu' or $::lsbdistcodename == 'Precise' { + package { 'npm': + name => $nodejs::params::npm_pkg, + ensure => present, + require => Anchor['nodejs::repo'] + } } if $proxy { diff --git a/spec/classes/nodejs_spec.rb b/spec/classes/nodejs_spec.rb index 7934be39..3c25356d 100644 --- a/spec/classes/nodejs_spec.rb +++ b/spec/classes/nodejs_spec.rb @@ -75,16 +75,17 @@ should_not contain_apt__ppa('ppa:chris-lea/node.js') end end + + it { should contain_class('apt') } + it { should contain_apt__ppa('ppa:chris-lea/node.js') } + it { should contain_apt__ppa('ppa:chris-lea/node.js-devel') } it { should contain_package('nodejs') } it { should contain_package('nodejs').with({ 'name' => 'nodejs', 'require' => 'Anchor[nodejs::repo]', }) } it { should contain_package('nodejs-dev') } - it { should contain_package('npm').with({ - 'name' => 'npm', - 'require' => 'Anchor[nodejs::repo]', - }) } + it { should_not contain_package('npm') } it { should_not contain_package('nodejs-stable-release') } end @@ -212,10 +213,7 @@ { :proxy => 'http://proxy.puppetlabs.lan:80/' } end - it { should contain_package('npm').with({ - 'name' => 'npm', - 'require' => 'Anchor[nodejs::repo]', - }) } + it { should_not contain_package('npm') } it { should contain_exec('npm_proxy').with({ 'command' => 'npm config set proxy http://proxy.puppetlabs.lan:80/', 'require' => 'Package[npm]',