Skip to content

Commit

Permalink
add better CentOS 8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Dacre committed Jun 23, 2020
1 parent 5ea3fbf commit 6c1e8a6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ matrix:
- rvm: 2.4.4
sudo: required
services: docker
env: BEAKER_set="rhel8-8" BEAKER_PUPPET_COLLECTION=puppet5
env: BEAKER_set="centos-8" BEAKER_PUPPET_COLLECTION=puppet5
bundler_args:
script: bundle exec rake beaker
- rvm: 2.5.3
sudo: required
services: docker
env: BEAKER_set="rhel-8" BEAKER_PUPPET_COLLECTION=puppet6
env: BEAKER_set="centos-8" BEAKER_PUPPET_COLLECTION=puppet6
bundler_args:
script: bundle exec rake beaker
- rvm: 2.4.4
Expand Down
6 changes: 3 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
if ($::facts['os']['name'] == 'Amazon') and !($::facts['os']['release']['major'] in ['2']) {
warning("osname Amazon's os.release.major is <${::facts['os']['release']['major']}> and must be 2.")
}
if !($::facts['os']['name'] == 'RedHat') and !($::facts['os']['release']['major'] in ['6', '7', '8']) {
warning("osname RedHat's os.release.major is <${::facts['os']['release']['major']}> and must be 6, 7 or 8.")
if !($::facts['os']['name'] in ['CentOS', 'RedHat']) and !($::facts['os']['release']['major'] in ['6', '7', '8']) {
warning("osname ${facts['os']['name']}'s os.release.major is <${::facts['os']['release']['major']}> and must be 6, 7 or 8.")
}
}

Expand Down Expand Up @@ -191,7 +191,7 @@
case $::osfamily {
'RedHat': {
if ($::facts['os']['name'] == 'Fedora' and versioncmp($::facts['os']['release']['major'], '28') >= 0) or
( $::facts['os']['name'] == 'Redhat' and versioncmp($::facts['os']['release']['major'], '8') >= 0) {
( $::facts['os']['name'] in ['CentOS', 'RedHat'] and versioncmp($::facts['os']['release']['major'], '8') >= 0) {
if $ensure == 'present' {
$authselect_options = join(
concat(
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": ["5","6","7"]
"operatingsystemrelease": ["5","6","7","8"]
},
{
"operatingsystem": "Fedora",
Expand Down
19 changes: 10 additions & 9 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
'major' => '8',
},
},
:service_provider => 'systemd',
},
},
'Fedora 29' => {
Expand Down Expand Up @@ -437,7 +438,7 @@
})
end

if v[:facts_hash][:os]['name'] == 'RedHat' and v[:facts_hash][:os]['release']['major'] < '8'
if ['CentOS', 'RedHat'].include? v[:facts_hash][:os]['name'] and v[:facts_hash][:os]['release']['major'] < '8'
it do
should contain_exec('authconfig-mkhomedir').with({
:command => '/usr/sbin/authconfig --enablesssd --enablesssdauth --enablemkhomedir --update',
Expand All @@ -447,7 +448,7 @@
end
end

if v[:facts_hash][:os]['name'] == 'RedHat' and v[:facts_hash][:os]['release']['major'] == '8'
if ['CentOS', 'RedHat'].include? v[:facts_hash][:os]['name'] and v[:facts_hash][:os]['release']['major'] == '8'
it do
should contain_exec('authselect-mkhomedir').with({
:command => '/bin/authselect select sssd with-mkhomedir --force',
Expand Down Expand Up @@ -598,7 +599,7 @@
v[:facts_hash]
end

if v[:facts_hash][:os]['name'] == 'RedHat' and v[:facts_hash][:os]['release']['major'] < '8'
if ['CentOS', 'RedHat'].include? v[:facts_hash][:os]['name'] and v[:facts_hash][:os]['release']['major'] < '8'
it do
should contain_exec('authconfig-mkhomedir').with({
:command => '/usr/sbin/authconfig --enablesssd --enablesssdauth --disablemkhomedir --update',
Expand All @@ -607,7 +608,7 @@
end
end

if v[:facts_hash][:os]['name'] == 'RedHat' and v[:facts_hash][:os]['release']['major'] == '8'
if ['CentOS', 'RedHat'].include? v[:facts_hash][:os]['name'] and v[:facts_hash][:os]['release']['major'] == '8'
it do
should contain_exec('authselect-mkhomedir').with({
:command => '/bin/authselect select sssd --force',
Expand Down Expand Up @@ -694,7 +695,7 @@
v[:facts_hash]
end

if v[:facts_hash][:os]['name'] == 'RedHat' and v[:facts_hash][:os]['release']['major'] < '8'
if ['CentOS', 'RedHat'].include? v[:facts_hash][:os]['name'] and v[:facts_hash][:os]['release']['major'] < '8'
it do
should contain_exec('authconfig-mkhomedir').with({
:command => '/usr/sbin/authconfig --enable1 --enable2 --update',
Expand All @@ -711,7 +712,7 @@
end
end

if v[:facts_hash][:os]['name'] == 'RedHat' and v[:facts_hash][:os]['release']['major'] == '8'
if ['CentOS', 'RedHat'].include? v[:facts_hash][:os]['name'] and v[:facts_hash][:os]['release']['major'] == '8'
it do
should contain_exec('authselect-mkhomedir').with({
:command => '/bin/authselect select profile --enable1 --enable2 --force',
Expand All @@ -732,7 +733,7 @@
v[:facts_hash]
end

if v[:facts_hash][:os]['name'] == 'RedHat' and v[:facts_hash][:os]['release']['major'] < '8'
if ['CentOS', 'RedHat'].include? v[:facts_hash][:os]['name'] and v[:facts_hash][:os]['release']['major'] < '8'
it do
should contain_exec('authconfig-mkhomedir').with({
:command => '/usr/sbin/authconfig --disable1 --disable2 --update',
Expand All @@ -749,7 +750,7 @@
end
end

if v[:facts_hash][:os]['name'] == 'RedHat' and v[:facts_hash][:os]['release']['major'] == '8'
if ['CentOS', 'RedHat'].include? v[:facts_hash][:os]['name'] and v[:facts_hash][:os]['release']['major'] == '8'
it do
should contain_exec('authselect-mkhomedir').with({
:command => '/bin/authselect select profile --disable1 --disable2 --force',
Expand All @@ -770,7 +771,7 @@
v[:facts_hash]
end

if v[:facts_hash][:os]['name'] == 'RedHat' and v[:facts_hash][:os]['release']['major'] < '8'
if ['CentOS', 'RedHat'].include? v[:facts_hash][:os]['name'] and v[:facts_hash][:os]['release']['major'] < '8'
it do
should contain_exec('authconfig-mkhomedir').with({
:command => '/usr/sbin/authconfig --absent1 --absent2 --update',
Expand Down

0 comments on commit 6c1e8a6

Please sign in to comment.