From 172f51eb7c500f5a4e354b0e5b2330b7a0d5c01a Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Mon, 13 Jan 2020 08:43:16 -0500 Subject: [PATCH] Fixes #28738: Reset bind host if :: is present This is necessary with smart proxy moving away from Ruby 2.0 via RPM packaging changes to use SCLs. --- .../200113133837-reset-bind-host-foreman-proxy.rb | 7 +++++++ .../20200113133837_reset_bind-host-foreman-proxy.rb | 7 +++++++ .../200113133837-reset-bind-host-foreman-proxy.rb | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 config/foreman-proxy-content.migrations/200113133837-reset-bind-host-foreman-proxy.rb create mode 100644 config/foreman.migrations/20200113133837_reset_bind-host-foreman-proxy.rb create mode 100644 config/katello.migrations/200113133837-reset-bind-host-foreman-proxy.rb diff --git a/config/foreman-proxy-content.migrations/200113133837-reset-bind-host-foreman-proxy.rb b/config/foreman-proxy-content.migrations/200113133837-reset-bind-host-foreman-proxy.rb new file mode 100644 index 00000000..0df41895 --- /dev/null +++ b/config/foreman-proxy-content.migrations/200113133837-reset-bind-host-foreman-proxy.rb @@ -0,0 +1,7 @@ +if answers['foreman_proxy'].is_a?(Hash) && + answers['foreman_proxy']['bind_host'].is_a?(Array) && + answers['foreman_proxy']['bind_host'].include?('::') && + facts[:os][:release][:major] == '7' && + facts[:os][:family] == 'RedHat' + answers['foreman_proxy']['bind_host'].delete +end diff --git a/config/foreman.migrations/20200113133837_reset_bind-host-foreman-proxy.rb b/config/foreman.migrations/20200113133837_reset_bind-host-foreman-proxy.rb new file mode 100644 index 00000000..0df41895 --- /dev/null +++ b/config/foreman.migrations/20200113133837_reset_bind-host-foreman-proxy.rb @@ -0,0 +1,7 @@ +if answers['foreman_proxy'].is_a?(Hash) && + answers['foreman_proxy']['bind_host'].is_a?(Array) && + answers['foreman_proxy']['bind_host'].include?('::') && + facts[:os][:release][:major] == '7' && + facts[:os][:family] == 'RedHat' + answers['foreman_proxy']['bind_host'].delete +end diff --git a/config/katello.migrations/200113133837-reset-bind-host-foreman-proxy.rb b/config/katello.migrations/200113133837-reset-bind-host-foreman-proxy.rb new file mode 100644 index 00000000..0df41895 --- /dev/null +++ b/config/katello.migrations/200113133837-reset-bind-host-foreman-proxy.rb @@ -0,0 +1,7 @@ +if answers['foreman_proxy'].is_a?(Hash) && + answers['foreman_proxy']['bind_host'].is_a?(Array) && + answers['foreman_proxy']['bind_host'].include?('::') && + facts[:os][:release][:major] == '7' && + facts[:os][:family] == 'RedHat' + answers['foreman_proxy']['bind_host'].delete +end