From 3fdf0b5656dd78bd504122abdf6be8f0c758389d Mon Sep 17 00:00:00 2001 From: Diego Tapia <64498901+dtapia-IT@users.noreply.github.com> Date: Thu, 7 Sep 2023 10:36:21 -0300 Subject: [PATCH] (chango) add network config and role --- hieradata/cluster/chango.yaml | 17 ++++++ hieradata/cluster/chango/role/rke.yaml | 4 ++ spec/hosts/nodes/chango01.ls.lsst.org_spec.rb | 56 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 hieradata/cluster/chango.yaml create mode 100644 hieradata/cluster/chango/role/rke.yaml create mode 100644 spec/hosts/nodes/chango01.ls.lsst.org_spec.rb diff --git a/hieradata/cluster/chango.yaml b/hieradata/cluster/chango.yaml new file mode 100644 index 0000000000..0809fa4b64 --- /dev/null +++ b/hieradata/cluster/chango.yaml @@ -0,0 +1,17 @@ +--- +clustershell::groupmembers: + chango: {group: "chango", member: "chango[01-03]"} +profile::core::rke::version: "1.4.6-rc4" +nm::connections: + eno1: #fqdn + content: | + [connection] + id=eno1 + uuid=de9904c8-9577-1a17-36b1-34b94132f06a + type=ethernet + interface-name=eno1 + [ethernet] + [ipv4] + method=auto + [ipv6] + method=disabled diff --git a/hieradata/cluster/chango/role/rke.yaml b/hieradata/cluster/chango/role/rke.yaml new file mode 100644 index 0000000000..275dc16ae8 --- /dev/null +++ b/hieradata/cluster/chango/role/rke.yaml @@ -0,0 +1,4 @@ +--- +classes: + - "profile::core::sysctl::rp_filter" +profile::core::sysctl::rp_filter::enable: false diff --git a/spec/hosts/nodes/chango01.ls.lsst.org_spec.rb b/spec/hosts/nodes/chango01.ls.lsst.org_spec.rb new file mode 100644 index 0000000000..7da9382e52 --- /dev/null +++ b/spec/hosts/nodes/chango01.ls.lsst.org_spec.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'chango01.ls.lsst.org', :sitepp do + alma9 = FacterDB.get_facts({ operatingsystem: 'AlmaLinux', operatingsystemmajrelease: '9' }).first + # rubocop:disable Naming/VariableNumber + { 'almalinux-9-x86_64': alma9 }.each do |os, facts| + # rubocop:enable Naming/VariableNumber + context "on #{os}" do + let(:facts) { override_facts(facts, fqdn: 'chango01.ls.lsst.org') } + let(:node_params) do + { + role: 'rke', + site: 'ls', + cluster: 'chango', + } + end + + include_context 'with nm interface' + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_class('profile::core::sysctl::rp_filter').with_enable(false) + end + + it do + is_expected.to contain_class('clustershell').with( + groupmembers: { + 'chango' => { + 'group' => 'chango', + 'member' => 'chango[01-03]', + }, + }, + ) + end + + it do + is_expected.to contain_class('profile::core::rke').with( + version: '1.4.6-rc4', + ) + end + + it { is_expected.to have_nm__connection_resource_count(1) } + + context 'with eno1' do + let(:interface) { 'eno1' } + + it_behaves_like 'nm enabled interface' + it_behaves_like 'nm dhcp interface' + it_behaves_like 'nm ethernet interface' + end + end # on os + end # on_supported_os +end