diff --git a/manifests/config/apache.pp b/manifests/config/apache.pp index 43ca86c7d..4e7c9e9b5 100644 --- a/manifests/config/apache.pp +++ b/manifests/config/apache.pp @@ -184,22 +184,8 @@ } # mod_proxy supports "ProxyPass ... upgrade=websocket" since 2.4.47 - # EL8: 2.4.37 / EL9: 2.4.62 / Debian11: 2.4.62 / Ubuntu20.04: 2.4.41 / Ubuntu22.04: 2.4.52 - $proxy_upgrade_websocket = !($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8') and !($facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '20.04') - if $proxy_upgrade_websocket { - $vhost_rewrites = [] - $_proxy_params = $proxy_params + { 'upgrade' => 'websocket' } - } else { - include apache::mod::proxy_wstunnel - $websockets_backend = regsubst($_proxy_backend, 'http://', 'ws://') - $websockets_rewrite = { - 'comment' => 'Upgrade Websocket connections', - 'rewrite_cond' => '%{HTTP:Upgrade} =websocket [NC]', - 'rewrite_rule' => "/(.*) ${websockets_backend}\$1 [P,L]", - } - $vhost_rewrites = [$websockets_rewrite] - $_proxy_params = $proxy_params - } + $vhost_rewrites = [] + $_proxy_params = $proxy_params + { 'upgrade' => 'websocket' } $vhost_http_request_headers = [ 'set X_FORWARDED_PROTO "http"', diff --git a/manifests/repo.pp b/manifests/repo.pp index 34bf06d81..2799731e1 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -20,15 +20,6 @@ yum_repo_baseurl => $yum_repo_baseurl, before => Anchor['foreman::repo'], } - - if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' { - package { 'foreman': - ensure => "el${facts['os']['release']['major']}", - enable_only => true, - provider => 'dnfmodule', - require => Foreman::Repos['foreman'], - } - } } # An anchor is used because it can be collected diff --git a/metadata.json b/metadata.json index c6948b0bd..597fd5a1b 100644 --- a/metadata.json +++ b/metadata.json @@ -55,14 +55,12 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "8", "9" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "8", "9" ] }, @@ -76,14 +74,12 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "20.04", "22.04" ] }, { "operatingsystem": "AlmaLinux", "operatingsystemrelease": [ - "8", "9" ] } diff --git a/spec/acceptance/foreman_cli_plugins_spec.rb b/spec/acceptance/foreman_cli_plugins_spec.rb index 51ef1fcae..2d150fc90 100644 --- a/spec/acceptance/foreman_cli_plugins_spec.rb +++ b/spec/acceptance/foreman_cli_plugins_spec.rb @@ -68,16 +68,6 @@ class { 'foreman::cli': gpgcheck => 0, } - if $facts['os']['release']['major'] == '8' { - package { 'katello': - ensure => "el${facts['os']['release']['major']}", - enable_only => true, - provider => 'dnfmodule', - require => Yumrepo['katello'], - } - Package['katello'] -> Class['foreman::cli::katello'] - } - class { 'foreman::cli': foreman_url => 'https://foreman.example.com', username => 'admin', diff --git a/spec/classes/foreman_config_apache_spec.rb b/spec/classes/foreman_config_apache_spec.rb index 4f9bb8144..88a5a5824 100644 --- a/spec/classes/foreman_config_apache_spec.rb +++ b/spec/classes/foreman_config_apache_spec.rb @@ -16,12 +16,7 @@ end let(:proxy_pass_params) do - if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '8') || - (facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'] == '20.04') - { 'retry' => '0' } - else - { 'retry' => '0', 'upgrade' => 'websocket' } - end + { 'retry' => '0', 'upgrade' => 'websocket' } end @@ -33,10 +28,6 @@ should contain_class('apache::mod::proxy') should contain_class('apache::mod::proxy_http') should contain_class('apache::mod::rewrite') - if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '8') || - (facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'] == '20.04') - should contain_class('apache::mod::proxy_wstunnel') - end end it 'does not manage the docroot' do @@ -94,17 +85,6 @@ "url" => 'unix:///run/foreman.sock|http://foreman/', "params" => proxy_pass_params, ) - if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '8') || - (facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'] == '20.04') - should contain_apache__vhost('foreman') - .with_rewrites([ - { - 'comment' => 'Upgrade Websocket connections', - 'rewrite_cond' => '%{HTTP:Upgrade} =websocket [NC]', - 'rewrite_rule' => '/(.*) unix:///run/foreman.sock|ws://foreman/$1 [P,L]', - }, - ]) - end end it 'does not configure the HTTPS vhost' do @@ -127,10 +107,6 @@ class { 'apache': should contain_class('apache::mod::proxy') should contain_class('apache::mod::proxy_http') should contain_class('apache::mod::rewrite') - if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '8') || - (facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'] == '20.04') - should contain_class('apache::mod::proxy_wstunnel') - end end end @@ -251,17 +227,6 @@ class { 'apache': "url" => 'unix:///run/foreman.sock|http://foreman/', "params" => proxy_pass_params, ) - if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '8') || - (facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'] == '20.04') - should contain_apache__vhost('foreman-ssl') - .with_rewrites([ - { - 'comment' => 'Upgrade Websocket connections', - 'rewrite_cond' => '%{HTTP:Upgrade} =websocket [NC]', - 'rewrite_rule' => '/(.*) unix:///run/foreman.sock|ws://foreman/$1 [P,L]', - }, - ]) - end end describe 'with vhost and ssl, no CRL explicitly' do diff --git a/spec/classes/foreman_repo_spec.rb b/spec/classes/foreman_repo_spec.rb index 9a0269e2d..b1ee8049d 100644 --- a/spec/classes/foreman_repo_spec.rb +++ b/spec/classes/foreman_repo_spec.rb @@ -22,11 +22,7 @@ } it do - if facts[:osfamily] == 'RedHat' && facts[:os]['release']['major'] == '8' - is_expected.to contain_package('foreman').with_ensure('el8').with_provider('dnfmodule') - else - is_expected.not_to contain_package('foreman') - end + is_expected.not_to contain_package('foreman') end end diff --git a/spec/classes/foreman_service_spec.rb b/spec/classes/foreman_service_spec.rb index 3438ae006..7f657132c 100644 --- a/spec/classes/foreman_service_spec.rb +++ b/spec/classes/foreman_service_spec.rb @@ -2,7 +2,7 @@ describe 'foreman::service' do let :facts do - on_supported_os['redhat-8-x86_64'] + on_supported_os['redhat-9-x86_64'] end let :params do diff --git a/spec/classes/plugin/remote_execution_cockpit_spec.rb b/spec/classes/plugin/remote_execution_cockpit_spec.rb index ebb92af89..faf4e7aec 100644 --- a/spec/classes/plugin/remote_execution_cockpit_spec.rb +++ b/spec/classes/plugin/remote_execution_cockpit_spec.rb @@ -69,18 +69,9 @@ class {'foreman': is_expected.to contain_foreman__config__apache__fragment('cockpit') .without_content .with_ssl_content(%r{^$}) - if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '8') || - (facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'] == '20.04') - is_expected.to contain_class('apache::mod::rewrite') - is_expected.to contain_class('apache::mod::proxy_wstunnel') - is_expected.to contain_foreman__config__apache__fragment('cockpit') - .with_ssl_content(%r{^ RewriteRule /webcon/\(\.\*\) ws://127\.0\.0\.1:19090/webcon/\$1 \[P\]$}) - .with_ssl_content(%r{^ ProxyPass http://127\.0\.0\.1:19090/webcon$}) - else - is_expected.to contain_foreman__config__apache__fragment('cockpit') - .without_ssl_content(%r{RewriteRule}) - .with_ssl_content(%r{^ ProxyPass http://127\.0\.0\.1:19090/webcon upgrade=websocket$}) - end + is_expected.to contain_foreman__config__apache__fragment('cockpit') + .without_ssl_content(%r{RewriteRule}) + .with_ssl_content(%r{^ ProxyPass http://127\.0\.0\.1:19090/webcon upgrade=websocket$}) end end diff --git a/spec/defines/foreman_rake_spec.rb b/spec/defines/foreman_rake_spec.rb index 7c0336cb2..1f7ccf71b 100644 --- a/spec/defines/foreman_rake_spec.rb +++ b/spec/defines/foreman_rake_spec.rb @@ -5,7 +5,7 @@ context 'on RedHat' do let :facts do - on_supported_os['redhat-8-x86_64'] + on_supported_os['redhat-9-x86_64'] end # These parameters are inherited normally, but here we cheat for performance diff --git a/spec/support/plugin.rb b/spec/support/plugin.rb index f53144f3c..3048a658c 100644 --- a/spec/support/plugin.rb +++ b/spec/support/plugin.rb @@ -1,4 +1,4 @@ -DEFAULT_OS_FACTS = on_supported_os['redhat-8-x86_64'] +DEFAULT_OS_FACTS = on_supported_os['redhat-9-x86_64'] shared_examples 'basic foreman plugin tests' do |name| let(:facts) { DEFAULT_OS_FACTS }