From e445ac1ab6cb9584b653e8b3128621fbb9febaeb Mon Sep 17 00:00:00 2001 From: Matthew Black Date: Wed, 16 Mar 2016 12:22:39 -0400 Subject: [PATCH] Fixed ubuntu package dependency on puppet 4.3 When running on puppet 4.3, the dependency for the package is set to 'apache2' but the actual package resource title in the puppetlabs-apache is 'httpd'. This change removes $http_service from being set depending on osfamily and makes it set to 'httpd' for all. Change-Id: I030446fabb7ec83c9ed94032e4ae54faff060e69 Closes-Bug: 1558131 --- manifests/wsgi/apache.pp | 8 ++++---- spec/classes/horizon_wsgi_apache_spec.rb | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index c0fa5ac3..083c391c 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -168,8 +168,8 @@ class horizon::wsgi::apache ( fail("Invalid redirect type '${redirect_type} provided.") } - Package['horizon'] -> Package[$::horizon::params::http_service] - File[$::horizon::params::config_file] ~> Service[$::horizon::params::http_service] + Package['horizon'] -> Package['httpd'] + File[$::horizon::params::config_file] ~> Service['httpd'] $unix_user = $::osfamily ? { 'RedHat' => $::horizon::params::apache_user, @@ -184,7 +184,7 @@ class horizon::wsgi::apache ( ensure => directory, owner => $unix_user, group => $unix_group, - before => Service[$::horizon::params::http_service], + before => Service['httpd'], mode => '0751', require => Package['horizon'], } @@ -193,7 +193,7 @@ class horizon::wsgi::apache ( ensure => file, owner => $unix_user, group => $unix_group, - before => Service[$::horizon::params::http_service], + before => Service['httpd'], mode => '0640', require => [ File[$::horizon::params::logdir], Package['horizon'] ], } diff --git a/spec/classes/horizon_wsgi_apache_spec.rb b/spec/classes/horizon_wsgi_apache_spec.rb index 9f1b0b03..dc9c66fb 100644 --- a/spec/classes/horizon_wsgi_apache_spec.rb +++ b/spec/classes/horizon_wsgi_apache_spec.rb @@ -33,6 +33,7 @@ describe 'horizon::wsgi::apache' do is_expected.to contain_class('apache') is_expected.to contain_class('apache::mod::wsgi') is_expected.to contain_service('httpd').with_name(platforms_params[:http_service]) + is_expected.to contain_package('httpd').with_name(platforms_params[:http_service]) is_expected.to contain_file(platforms_params[:httpd_config_file]) is_expected.to contain_package('horizon').with_ensure('present') is_expected.to contain_apache__vhost('horizon_vhost').with( @@ -68,6 +69,7 @@ describe 'horizon::wsgi::apache' do is_expected.to contain_class('apache') is_expected.to contain_class('apache::mod::wsgi') is_expected.to contain_service('httpd').with_name(platforms_params[:http_service]) + is_expected.to contain_package('httpd').with_name(platforms_params[:http_service]) is_expected.to contain_file(platforms_params[:httpd_config_file]) is_expected.to contain_package('horizon').with_ensure('present') is_expected.to contain_apache__vhost('horizon_vhost').with(