Skip to content

Commit

Permalink
Merge pull request #413 from mmoll/rh8
Browse files Browse the repository at this point in the history
Add support for RHEL 8 based distros
  • Loading branch information
bastelfreak authored Jan 22, 2020
2 parents e594e71 + 0b3f0be commit cc2c86f
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 8 deletions.
1 change: 1 addition & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- set: ubuntu1604-64
- set: ubuntu1804-64
- set: centos7-64
- set: centos8-64
- set: debian8-64
- set: debian9-64
- set: debian10-64
Expand Down
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ matrix:
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos8-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos8-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ this with the package_provider parameter to use an alternative

This module has received limited testing on:

* CentOS/RHEL 6/7
* CentOS/RHEL 6/7/8
* Debian 8
* Ubuntu 16.04/18.04

Expand Down
5 changes: 5 additions & 0 deletions files/repo/dnf/nodejs.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[nodejs]
name=nodejs
stream=
profiles=
state=disabled
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
$package_provider = undef
}
'RedHat': {
if $facts['os']['release']['major'] =~ /^[67]$/ {
if $facts['os']['release']['major'] =~ /^[678]$/ {
$manage_package_repo = true
$nodejs_debug_package_name = 'nodejs-debuginfo'
$nodejs_dev_package_name = 'nodejs-devel'
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo/nodesource.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

case $facts['os']['family'] {
'RedHat': {
if $facts['os']['release']['major'] =~ /^[67]$/ {
if $facts['os']['release']['major'] =~ /^[678]$/ {
$dist_version = $facts['os']['release']['major']
$name_string = "Enterprise Linux ${dist_version}"
}
Expand Down
17 changes: 17 additions & 0 deletions manifests/repo/nodesource/yum.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
}

if ($ensure == 'present') {
if $facts['os']['release']['major'] == '8' {
file { 'dnf_module':
ensure => file,
path => '/etc/dnf/modules.d/nodejs.module',
group => '0',
mode => '0644',
owner => 'root',
source => "puppet:///modules/${module_name}/repo/dnf/nodejs.module",
}
}

yumrepo { 'nodesource':
descr => $descr,
Expand Down Expand Up @@ -64,5 +74,12 @@
yumrepo { 'nodesource-source':
ensure => 'absent',
}

if $facts['os']['release']['major'] == '8' {
file { 'dnf_module':
ensure => absent,
path => '/etc/dnf/modules.d/nodejs.module',
}
}
}
}
12 changes: 8 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,32 @@
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"6",
"7"
"7",
"8"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"6",
"7"
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"6",
"7"
"7",
"8"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"6",
"7"
"7",
"8"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
end
end

context 'repo_class => epel', if: fact('os.family') == 'RedHat' do
context 'repo_class => epel', if: ((fact('os.family') == 'RedHat') && (fact('os.release.major') != '8')) do
let(:pp) { "class { 'nodejs': repo_class => '::epel' }" }

it_behaves_like 'an idempotent resource'
Expand Down

0 comments on commit cc2c86f

Please sign in to comment.