Skip to content

Commit

Permalink
Merge pull request voxpupuli#100 from atrepca/master
Browse files Browse the repository at this point in the history
Replace Chris Lea's PPA with the Nodesource repo
  • Loading branch information
cmurphy committed Dec 12, 2014
2 parents 39d79c6 + 4a9346d commit cafa297
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
19 changes: 14 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,23 @@
if $manage_repo {
# Only add apt source if we're managing the repo
include 'apt'
# Only use PPA when necessary.
apt::ppa { 'ppa:chris-lea/node.js':
before => Anchor['nodejs::repo'],
# Add the NodeSource repo
apt::source { 'nodesource':
location => 'https://deb.nodesource.com/node',
repos => 'main',
key => '68576280',
key_source => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key',
before => Anchor['nodejs::repo'],
}

if $dev_package {
apt::ppa { 'ppa:chris-lea/node.js-devel':
before => Anchor['nodejs::repo'],
# Add the NodeSource devel repo
apt::source { 'nodesource-devel':
location => 'https://deb.nodesource.com/node-devel',
repos => 'main',
key => '68576280',
key_source => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key',
before => Anchor['nodejs::repo'],
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/nodejs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@
end
context 'when manage_repo is true' do
it { should contain_class('apt') }
it { should contain_apt__ppa('ppa:chris-lea/node.js') }
it { should contain_apt__source('nodesource') }
end
context 'when manage_repo is false' do
it 'should not create the ppa' do
params.merge!({:manage_repo => false})
should_not contain_class('apt')
should_not contain_apt__ppa('ppa:chris-lea/node.js')
should_not contain_apt__source('nodesource')
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_apt__source('nodesource') }
it { should contain_apt__source('nodesource-devel') }
it { should contain_package('nodejs') }
it { should contain_package('nodejs').with({
'name' => 'nodejs',
Expand Down

0 comments on commit cafa297

Please sign in to comment.