From 2bc6a5a854db2a948a355ed4c34f519abf7fa7c1 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 20 Sep 2019 20:51:13 +0200 Subject: [PATCH 1/2] Fix tests for pulp3.yml's puppet_content_dir removal b6d610016ca1d74ba78517bc2e898b19c26083c4 removed the parameter but missed one in the tests. --- spec/classes/foreman_proxy__plugin__pulp_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/classes/foreman_proxy__plugin__pulp_spec.rb b/spec/classes/foreman_proxy__plugin__pulp_spec.rb index f7c660af..2aab02b9 100644 --- a/spec/classes/foreman_proxy__plugin__pulp_spec.rb +++ b/spec/classes/foreman_proxy__plugin__pulp_spec.rb @@ -131,7 +131,6 @@ ':pulp_url: https://pulp.example.com', ':pulp_dir: /tmp/pulp', ':pulp_content_dir: /tmp/content', - ':puppet_content_dir: /tmp/puppet', ':mirror: true' ]) end From 777b0c54493d35e87be8355495a4a1bf367e36a3 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 20 Sep 2019 19:40:39 +0200 Subject: [PATCH 2/2] Gracefully handle a missing IP address Not all machines have an IPv4 address. The datatype is `Optional[String]` so this is valid. --- manifests/params.pp | 2 +- spec/classes/foreman_proxy__spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 717737de..cc9f0755 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -278,7 +278,7 @@ $dhcp_key_secret = undef $dhcp_omapi_port = 7911 $dhcp_node_type = 'standalone' - $dhcp_failover_address = $::ipaddress + $dhcp_failover_address = fact('ipaddress') $dhcp_peer_address = undef $dhcp_failover_port = 519 $dhcp_max_response_delay = 30 diff --git a/spec/classes/foreman_proxy__spec.rb b/spec/classes/foreman_proxy__spec.rb index a64ac616..e1d52089 100644 --- a/spec/classes/foreman_proxy__spec.rb +++ b/spec/classes/foreman_proxy__spec.rb @@ -141,6 +141,12 @@ end end + context 'without IPv4' do + let(:facts) { super().reject { |fact| fact == :ipaddress } } + + it { is_expected.to compile.with_all_deps } + end + context 'without IPv6' do let(:facts) { super().reject { |fact| fact == :ipaddress6 } }