From 237975b73a3576c177c2733c82fb660b736d593a Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 8 Dec 2021 23:04:08 +0900 Subject: [PATCH] Clean up direct dependencies on puppetlabs-apache This change removes direct reference to some classes in puppetlabs-apache. Details are explained below. - The api class doesn't need access to anything defined in apache::params - The following classes are included by the openstacklib::wsgi::apache resource type, and current inclusions are just redundant. Dependencies defined in mistral::wsgi::apache are removed and loosen to avoid direct deference to resources from puppetlabs-apache. When httpd is used to run mistral-api, the mistral-service tag is added to the httpd service, so that it is started during service phase. Change-Id: Ia6edb3f8ceefa4d2480c33aee7893d7f43166eb9 --- manifests/api.pp | 1 - manifests/wsgi/apache.pp | 25 ------------------------ metadata.json | 4 ---- spec/classes/mistral_wsgi_apache_spec.rb | 6 ------ 4 files changed, 36 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index cb3588c..b398108 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -104,7 +104,6 @@ class mistral::api ( tag => 'mistral-service', } } elsif $service_name == 'httpd' { - include apache::params service { 'mistral-api': ensure => 'stopped', name => $::mistral::params::api_service_name, diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 91e1d7e..2911fe3 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -136,31 +136,6 @@ class mistral::wsgi::apache ( include mistral::deps include mistral::params - include apache - include apache::mod::wsgi - if $ssl_real { - include apache::mod::ssl - } - - # The httpd package is untagged, but needs to have ordering enforced, - # so handle it here rather than in the deps class. - Anchor['mistral::install::begin'] - -> Package['httpd'] - -> Anchor['mistral::install::end'] - - # Configure apache during the config phase - Anchor['mistral::config::begin'] - -> Apache::Vhost<||> - ~> Anchor['mistral::config::end'] - - # Start the service during the service phase - Anchor['mistral::service::begin'] - -> Service['httpd'] - -> Anchor['mistral::service::end'] - - # Notify the service when config changes - Anchor['mistral::config::end'] - ~> Service['httpd'] ::openstacklib::wsgi::apache { 'mistral_wsgi': bind_host => $bind_host, diff --git a/metadata.json b/metadata.json index f884c9f..4adb5ab 100644 --- a/metadata.json +++ b/metadata.json @@ -1,10 +1,6 @@ { "author": "OpenStack Contributors", "dependencies": [ - { - "name": "puppetlabs/apache", - "version_requirement": ">=5.0.0" - }, { "name": "puppetlabs/inifile", "version_requirement": ">=2.0.0 <6.0.0" diff --git a/spec/classes/mistral_wsgi_apache_spec.rb b/spec/classes/mistral_wsgi_apache_spec.rb index 4eaee6b..e077bb2 100644 --- a/spec/classes/mistral_wsgi_apache_spec.rb +++ b/spec/classes/mistral_wsgi_apache_spec.rb @@ -6,9 +6,6 @@ describe 'mistral::wsgi::apache' do context 'with default parameters' do it { is_expected.to contain_class('mistral::deps') } it { is_expected.to contain_class('mistral::params') } - it { is_expected.to contain_class('apache') } - it { is_expected.to contain_class('apache::mod::wsgi') } - it { is_expected.to contain_class('apache::mod::ssl') } it { is_expected.to contain_openstacklib__wsgi__apache('mistral_wsgi').with( :bind_port => 8989, :group => 'mistral', @@ -49,9 +46,6 @@ describe 'mistral::wsgi::apache' do end it { is_expected.to contain_class('mistral::deps') } it { is_expected.to contain_class('mistral::params') } - it { is_expected.to contain_class('apache') } - it { is_expected.to contain_class('apache::mod::wsgi') } - it { is_expected.to_not contain_class('apache::mod::ssl') } it { is_expected.to contain_openstacklib__wsgi__apache('mistral_wsgi').with( :bind_host => '10.42.51.1', :bind_port => 12345,