From 6fee63ec74f47833aaf40a5ff4af143868ceecd9 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Mon, 8 Apr 2024 12:24:43 -0700 Subject: [PATCH] (node/tang03.cp.lsst.org) add static ip --- hieradata/node/tang03.cp.lsst.org.yaml | 18 ++++++++ spec/hosts/nodes/tang03.cp.lsst.org_spec.rb | 46 +++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 hieradata/node/tang03.cp.lsst.org.yaml create mode 100644 spec/hosts/nodes/tang03.cp.lsst.org_spec.rb diff --git a/hieradata/node/tang03.cp.lsst.org.yaml b/hieradata/node/tang03.cp.lsst.org.yaml new file mode 100644 index 0000000000..dc07100f2a --- /dev/null +++ b/hieradata/node/tang03.cp.lsst.org.yaml @@ -0,0 +1,18 @@ +--- +nm::connections: + enp1s0: + content: + connection: + id: "enp1s0" + uuid: "03da7500-2101-c722-2438-d0d006c28c73" + type: "ethernet" + interface-name: "enp1s0" + ethernet: {} + ipv4: + address1: "139.229.161.6/27,139.229.161.30" + dns: "139.229.160.53;139.229.160.54;139.229.160.55;" + dns-search: "cp.lsst.org;" + method: "manual" + ipv6: + method: "disabled" + proxy: {} diff --git a/spec/hosts/nodes/tang03.cp.lsst.org_spec.rb b/spec/hosts/nodes/tang03.cp.lsst.org_spec.rb new file mode 100644 index 0000000000..b3d9c52b91 --- /dev/null +++ b/spec/hosts/nodes/tang03.cp.lsst.org_spec.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'tang03.cp.lsst.org', :sitepp do + on_supported_os.each do |os, os_facts| + next unless os =~ %r{almalinux-9-x86_64} + + context "on #{os}" do + let(:facts) do + override_facts(os_facts, + fqdn: 'tang03.cp.lsst.org', + is_virtual: true, + virtual: 'kvm', + dmi: { + 'product' => { + 'name' => 'KVM', + }, + }) + end + let(:node_params) do + { + role: 'tang', + site: 'cp', + } + end + + it { is_expected.to compile.with_all_deps } + + include_examples 'vm' + include_context 'with nm interface' + it { is_expected.to have_nm__connection_resource_count(1) } + + context 'with enp1s0' do + let(:interface) { 'enp1s0' } + + it_behaves_like 'nm enabled interface' + it_behaves_like 'nm ethernet interface' + it_behaves_like 'nm manual interface' + it { expect(nm_keyfile['ipv4']['address1']).to eq('139.229.161.6/27,139.229.161.30') } + it { expect(nm_keyfile['ipv4']['dns']).to eq('139.229.160.53;139.229.160.54;139.229.160.55;') } + it { expect(nm_keyfile['ipv4']['dns-search']).to eq('cp.lsst.org;') } + end + end # on os + end # on_supported_os +end