Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Fix metapackage linking on Ubuntu 14.04
Browse files Browse the repository at this point in the history
It's optional (and enabled by default) to manage dependencies of the
module needed during deployment with `package` declarations (see
`build_deps` and `::nodejs::pkgs`).

However the `rubygems` package which explicitly ensures that the `gem`
provider is functional on each host is a metapackage that will be
replaced by `ruby`. This "linking" doesn't work on Ubuntu 14.04 LTS
which is still supported (please refer to the forum for further
reference: https://askubuntu.com/questions/613074/package-rubygems-has-no-installation-candidate).

Now each OS with `$::osfamily == 'Debian'` uses `rubygems-integration`
to fix the broken linking.

Fixes #181
  • Loading branch information
Ma27 committed Jun 8, 2018
1 parent e768246 commit b59c504
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion manifests/instance/pkgs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
warning('nodejs::instance::pkgs is private!')
}

ensure_packages(['tar', 'wget', 'ruby', 'rubygems'])
$rubygems = $::osfamily ? {
'Debian' => 'rubygems-integration',
default => 'rubygems'
}

ensure_packages(['tar', 'wget', 'ruby', $rubygems])
ensure_packages(['semver'], {
provider => gem,
require => Package['ruby'],
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/nodejs_instance_pkgs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@

describe 'nodejs::instance::pkgs', :type => :class do
let(:title) { 'nodejs::instance::pkgs' }
let(:facts) {{
:osfamily => 'Debian'
}}

describe 'module dependency management' do
it { should contain_package('wget') }
it { should contain_package('tar') }
it { should contain_package('rubygems-integration') }
end

describe 'redhat OS' do
let(:facts) {{
:osfamily => 'RedHat',
}}
it { should contain_package('rubygems') }
end

describe 'includes compiler-related dependencies' do
Expand Down

0 comments on commit b59c504

Please sign in to comment.