From 0073b7fe5bed96705b987250ef534a4fb8645ae0 Mon Sep 17 00:00:00 2001 From: markuszilch Date: Mon, 8 Apr 2024 21:55:05 +0200 Subject: [PATCH 1/3] replace legacy osfamily fact with modern fact in acceptance tests --- spec/acceptance/cs_order_spec.rb | 4 ++-- spec/acceptance/cs_primitive_spec.rb | 2 +- spec/acceptance/cs_rsc_defaults_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/acceptance/cs_order_spec.rb b/spec/acceptance/cs_order_spec.rb index a97e1802..1aa70777 100644 --- a/spec/acceptance/cs_order_spec.rb +++ b/spec/acceptance/cs_order_spec.rb @@ -105,7 +105,7 @@ class { 'corosync': end end - if fact('osfamily') == 'RedHat' + if $facts['os']['family'] == 'RedHat' it 'creates a simple order constraint with Mandatory as kind' do shell('cibadmin --query | grep first_then_two') do |r| expect(r.stdout).to match(%r{kind="Mandatory"}) @@ -165,7 +165,7 @@ class { 'corosync': end end - if fact('osfamily') == 'RedHat' + if $facts['os']['family'] == 'RedHat' it 'creates a more complex order constraint with Optional as kind' do shell('cibadmin --query | grep one_then_two_complex') do |r| expect(r.stdout).to match(%r{kind="Optional"}) diff --git a/spec/acceptance/cs_primitive_spec.rb b/spec/acceptance/cs_primitive_spec.rb index 7ffdb6f1..53269312 100644 --- a/spec/acceptance/cs_primitive_spec.rb +++ b/spec/acceptance/cs_primitive_spec.rb @@ -328,7 +328,7 @@ class { 'corosync': }, } EOS - if fact('osfamily') == 'RedHat' + if $facts['os']['family'] == 'RedHat' apply_manifest(pp, catch_failures: true, debug: false, trace: true) apply_manifest(pp, catch_changes: true, debug: false, trace: true) shell('pcs stonith show') do |r| diff --git a/spec/acceptance/cs_rsc_defaults_spec.rb b/spec/acceptance/cs_rsc_defaults_spec.rb index 581efe06..8df72918 100644 --- a/spec/acceptance/cs_rsc_defaults_spec.rb +++ b/spec/acceptance/cs_rsc_defaults_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper_acceptance' describe 'corosync' do - if fact('osfamily') == 'Debian' + if $facts['os']['family'] == 'Debian' cert = '-----BEGIN CERTIFICATE----- MIIDVzCCAj+gAwIBAgIJAJNCo5ZPmKegMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg From 7bec3980aa49a4c90e7aa31e4d02424ba8f1cb1e Mon Sep 17 00:00:00 2001 From: markuszilch Date: Mon, 8 Apr 2024 22:52:00 +0200 Subject: [PATCH 2/3] modernize readme example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d5c8405b..77cc27a9 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ providers). ```puppet class { 'corosync': authkey => '/var/lib/puppet/ssl/certs/ca.pem', - bind_address => $::ipaddress, + bind_address => $facts['networking']['ip'], cluster_name => 'mycluster', enable_secauth => true, } From a1fe1cca184a60fc0e70ec7595cd3d8cdff7d37c Mon Sep 17 00:00:00 2001 From: markuszilch Date: Mon, 8 Apr 2024 23:07:36 +0200 Subject: [PATCH 3/3] use fact function again --- spec/acceptance/cs_order_spec.rb | 4 ++-- spec/acceptance/cs_primitive_spec.rb | 2 +- spec/acceptance/cs_rsc_defaults_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/acceptance/cs_order_spec.rb b/spec/acceptance/cs_order_spec.rb index 1aa70777..f008f800 100644 --- a/spec/acceptance/cs_order_spec.rb +++ b/spec/acceptance/cs_order_spec.rb @@ -105,7 +105,7 @@ class { 'corosync': end end - if $facts['os']['family'] == 'RedHat' + if fact('os.family') == 'RedHat' it 'creates a simple order constraint with Mandatory as kind' do shell('cibadmin --query | grep first_then_two') do |r| expect(r.stdout).to match(%r{kind="Mandatory"}) @@ -165,7 +165,7 @@ class { 'corosync': end end - if $facts['os']['family'] == 'RedHat' + if fact('os.family') == 'RedHat' it 'creates a more complex order constraint with Optional as kind' do shell('cibadmin --query | grep one_then_two_complex') do |r| expect(r.stdout).to match(%r{kind="Optional"}) diff --git a/spec/acceptance/cs_primitive_spec.rb b/spec/acceptance/cs_primitive_spec.rb index 53269312..823be675 100644 --- a/spec/acceptance/cs_primitive_spec.rb +++ b/spec/acceptance/cs_primitive_spec.rb @@ -328,7 +328,7 @@ class { 'corosync': }, } EOS - if $facts['os']['family'] == 'RedHat' + if fact('os.family') == 'RedHat' apply_manifest(pp, catch_failures: true, debug: false, trace: true) apply_manifest(pp, catch_changes: true, debug: false, trace: true) shell('pcs stonith show') do |r| diff --git a/spec/acceptance/cs_rsc_defaults_spec.rb b/spec/acceptance/cs_rsc_defaults_spec.rb index 8df72918..389cd38a 100644 --- a/spec/acceptance/cs_rsc_defaults_spec.rb +++ b/spec/acceptance/cs_rsc_defaults_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper_acceptance' describe 'corosync' do - if $facts['os']['family'] == 'Debian' + if fact('os.family') == 'Debian' cert = '-----BEGIN CERTIFICATE----- MIIDVzCCAj+gAwIBAgIJAJNCo5ZPmKegMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg