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
This commit is contained in:
Matthew Black 2016-03-16 12:22:39 -04:00
parent 57ff7518cf
commit e445ac1ab6
2 changed files with 6 additions and 4 deletions

View File

@ -168,8 +168,8 @@ class horizon::wsgi::apache (
fail("Invalid redirect type '${redirect_type} provided.") fail("Invalid redirect type '${redirect_type} provided.")
} }
Package['horizon'] -> Package[$::horizon::params::http_service] Package['horizon'] -> Package['httpd']
File[$::horizon::params::config_file] ~> Service[$::horizon::params::http_service] File[$::horizon::params::config_file] ~> Service['httpd']
$unix_user = $::osfamily ? { $unix_user = $::osfamily ? {
'RedHat' => $::horizon::params::apache_user, 'RedHat' => $::horizon::params::apache_user,
@ -184,7 +184,7 @@ class horizon::wsgi::apache (
ensure => directory, ensure => directory,
owner => $unix_user, owner => $unix_user,
group => $unix_group, group => $unix_group,
before => Service[$::horizon::params::http_service], before => Service['httpd'],
mode => '0751', mode => '0751',
require => Package['horizon'], require => Package['horizon'],
} }
@ -193,7 +193,7 @@ class horizon::wsgi::apache (
ensure => file, ensure => file,
owner => $unix_user, owner => $unix_user,
group => $unix_group, group => $unix_group,
before => Service[$::horizon::params::http_service], before => Service['httpd'],
mode => '0640', mode => '0640',
require => [ File[$::horizon::params::logdir], Package['horizon'] ], require => [ File[$::horizon::params::logdir], Package['horizon'] ],
} }

View File

@ -33,6 +33,7 @@ describe 'horizon::wsgi::apache' do
is_expected.to contain_class('apache') is_expected.to contain_class('apache')
is_expected.to contain_class('apache::mod::wsgi') is_expected.to contain_class('apache::mod::wsgi')
is_expected.to contain_service('httpd').with_name(platforms_params[:http_service]) 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_file(platforms_params[:httpd_config_file])
is_expected.to contain_package('horizon').with_ensure('present') is_expected.to contain_package('horizon').with_ensure('present')
is_expected.to contain_apache__vhost('horizon_vhost').with( 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')
is_expected.to contain_class('apache::mod::wsgi') is_expected.to contain_class('apache::mod::wsgi')
is_expected.to contain_service('httpd').with_name(platforms_params[:http_service]) 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_file(platforms_params[:httpd_config_file])
is_expected.to contain_package('horizon').with_ensure('present') is_expected.to contain_package('horizon').with_ensure('present')
is_expected.to contain_apache__vhost('horizon_vhost').with( is_expected.to contain_apache__vhost('horizon_vhost').with(