Fix races in httpd install and config

Add necessary dependency/ordering hints to the etherpad_lite::apache
class so that configuration parent directories are created before
they're needed rather than later through package installation, and
so that vhost configuration won't be loaded until Apache module
dependencies are in place.

Change-Id: Iaeafd30b19276ff438bd9e2708031c1064a2314d
This commit is contained in:
Jeremy Stanley 2015-08-20 14:39:25 +00:00 committed by Yolanda Robla
parent 957ecb6cef
commit 86d9628a5a

View File

@ -24,17 +24,37 @@ class etherpad_lite::apache (
template => 'etherpad_lite/etherpadlite.vhost.erb', template => 'etherpad_lite/etherpadlite.vhost.erb',
ssl => true, ssl => true,
} }
httpd_mod { 'rewrite':
if !defined(Mod['rewrite']) {
httpd::mod { 'rewrite':
ensure => present, ensure => present,
} }
httpd_mod { 'proxy': }
if !defined(Mod['proxy']) {
httpd::mod { 'proxy':
ensure => present, ensure => present,
} }
httpd_mod { 'proxy_http': }
if !defined(Mod['proxy_http']) {
httpd::mod { 'proxy_http':
ensure => present, ensure => present,
} }
}
file { '/etc/apache2':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
if ($::lsbdistcodename == 'precise') { if ($::lsbdistcodename == 'precise') {
file { '/etc/apache2/conf.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
require => File['/etc/apache2'],
}
file { '/etc/apache2/conf.d/connection-tuning': file { '/etc/apache2/conf.d/connection-tuning':
ensure => present, ensure => present,
owner => 'root', owner => 'root',
@ -42,25 +62,40 @@ class etherpad_lite::apache (
mode => '0644', mode => '0644',
source => 'puppet:///modules/etherpad_lite/apache-connection-tuning', source => 'puppet:///modules/etherpad_lite/apache-connection-tuning',
notify => Service['httpd'], notify => Service['httpd'],
require => File['/etc/apache2/conf.d'],
} }
} else { } else {
file { '/etc/apache2/conf-available/connection-tuning.conf': file { '/etc/apache2/conf-available':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
require => File['/etc/apache2'],
}
file { '/etc/apache2/conf-available/connection-tuning':
ensure => present, ensure => present,
owner => 'root', owner => 'root',
group => 'root', group => 'root',
mode => '0644', mode => '0644',
source => 'puppet:///modules/etherpad_lite/apache-connection-tuning', source => 'puppet:///modules/etherpad_lite/apache-connection-tuning',
require => File['/etc/apache2/conf-available'],
} }
file { '/etc/apache2/conf-enabled/connection-tuning.conf': file { '/etc/apache2/conf-enabled':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
require => File['/etc/apache2'],
}
file { '/etc/apache2/conf-enabled/connection-tuning':
ensure => link, ensure => link,
target => '/etc/apache2/conf-available/connection-tuning.conf', target => '/etc/apache2/conf-available/connection-tuning.conf',
notify => Service['httpd'], notify => Service['httpd'],
require => File['/etc/apache2/conf-available/connection-tuning.conf'], require => [
} File['/etc/apache2/conf-enabled'],
File['/etc/apache2/conf-available/connection-tuning'],
httpd_mod { 'proxy_wstunnel': ],
ensure => present,
} }
} }