Skip to content

Commit

Permalink
(rke role) restrict inclusion of clustershell class to EL7/EL8
Browse files Browse the repository at this point in the history
There does not [yet] appear to be a clustershell package in EPEL9.
  • Loading branch information
jhoblitt committed Nov 22, 2022
1 parent ca484a9 commit 825381e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
1 change: 0 additions & 1 deletion hieradata/role/rke.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
classes:
- "clustershell"
- "kubectl"
- "profile::core::common"
- "profile::core::debugutils"
Expand Down
3 changes: 3 additions & 0 deletions hieradata/role/rke/osfamily/RedHat/major/7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
classes:
- "clustershell"
3 changes: 3 additions & 0 deletions hieradata/role/rke/osfamily/RedHat/major/8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
classes:
- "clustershell"
15 changes: 11 additions & 4 deletions spec/hosts/roles/rke_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper'

shared_examples 'generic rke' do
shared_examples 'generic rke' do |facts:|
include_examples 'debugutils'
include_examples 'docker'
include_examples 'rke profile'
Expand All @@ -15,6 +15,14 @@
.with_content(%r{^alias k='kubectl'$})
.with_content(%r{^complete -o default -F __start_kubectl k$})
end

if facts[:os]['family'] == 'RedHat'
if facts[:os]['release']['major'] == '9'
it { is_expected.not_to contain_class('clustershell') }
else
it { is_expected.to contain_class('clustershell') }
end
end
end

role = 'rke'
Expand Down Expand Up @@ -42,8 +50,7 @@
it { is_expected.to compile.with_all_deps }

include_examples 'common', facts: facts

include_examples 'generic rke'
include_examples 'generic rke', facts: facts
end # host
end # lsst_sites

Expand All @@ -61,7 +68,7 @@
it { is_expected.to compile.with_all_deps }

include_examples 'common', facts: facts
include_examples 'generic rke'
include_examples 'generic rke', facts: facts
end
end
end # on os
Expand Down

0 comments on commit 825381e

Please sign in to comment.