Skip to content

Commit

Permalink
Make repo::nodesource::apt compatible with puppetlabs-apt 2.x only
Browse files Browse the repository at this point in the history
  • Loading branch information
juniorsysadmin committed Jun 6, 2015
1 parent 819a521 commit 70060bc
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
4 changes: 1 addition & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
fixtures:
repositories:
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
"apt":
repo: "git://github.com/puppetlabs/puppetlabs-apt.git"
ref: "1.8.0"
"apt": "git://github.com/puppetlabs/puppetlabs-apt.git"
"portage": "git://github.com/gentoo/puppet-portage.git"
"chocolatey": "git://github.com/chocolatey/puppet-chocolatey.git"
"epel": "git://github.com/stahnma/puppet-module-epel.git"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Make nodejs::repo::nodesource::apt compatible with puppetlabs-apt 2.x only
##2015-05-20 1.0.0
###Summary

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ it is installed.

This modules uses `puppetlabs-apt` for the management of the NodeSource
repository. If using an operating system of the Debian-based family, you will
need to ensure that `puppetlabs-apt` version 1.x is installed.
need to ensure that `puppetlabs-apt` version 2.x is installed.

If using CentoOS/RHEL 5, you will need to ensure that the `stahnma-epel`
module is installed.
Expand Down
25 changes: 17 additions & 8 deletions manifests/repo/nodesource/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,27 @@
$pin = $nodejs::repo::nodesource::pin
$url_suffix = $nodejs::repo::nodesource::url_suffix

ensure_packages(['apt-transport-https', 'ca-certificates'])

include ::apt

if ($ensure == 'present') {
apt::source { 'nodesource':
include_src => $enable_src,
key => '9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280',
key_source => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key',
location => "https://deb.nodesource.com/${url_suffix}",
pin => $pin,
release => $::lsbdistcodename,
repos => 'main',
required_packages => 'apt-transport-https ca-certificates',
include => {
'src' => $enable_src
},
key => {
'id' => '9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280',
'source' => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key',
},
location => "https://deb.nodesource.com/${url_suffix}",
pin => $pin,
release => $::lsbdistcodename,
repos => 'main',
require => [
Package['apt-transport-https'],
Package['ca-certificates'],
],
}
}

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
}
],
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">=3.0.0 <5.0.0"}
{"name":"puppetlabs/stdlib","version_requirement":">=4.1.0 <5.0.0"}
]
}
4 changes: 2 additions & 2 deletions spec/classes/nodejs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

it 'the repo apt::source resource should contain include_src = true' do
should contain_apt__source('nodesource').with({
'include_src' => true,
'include' => { 'src' => true, },
})
end
end
Expand All @@ -115,7 +115,7 @@

it 'the repo apt::source resource should contain include_src = false' do
should contain_apt__source('nodesource').with({
'include_src' => false,
'include' => { 'src' => false, },
})
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
hosts.each do |host|
copy_module_to(host, :source => proj_root, :module_name => 'nodejs')
shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
on host, puppet('module install puppetlabs-apt --version 1.8.0'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module install puppetlabs-apt --version 2.0.1'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module install gentoo-portage --version 2.0.1'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module install chocolatey-chocolatey --version 0.5.2'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module install stahnma-epel --version 1.0.0'), { :acceptable_exit_codes => [0,1] }
Expand Down

0 comments on commit 70060bc

Please sign in to comment.