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
1 changed files with 59 additions and 24 deletions

View File

@ -24,43 +24,78 @@ class etherpad_lite::apache (
template => 'etherpad_lite/etherpadlite.vhost.erb',
ssl => true,
}
httpd_mod { 'rewrite':
ensure => present,
if !defined(Mod['rewrite']) {
httpd::mod { 'rewrite':
ensure => present,
}
}
httpd_mod { 'proxy':
ensure => present,
if !defined(Mod['proxy']) {
httpd::mod { 'proxy':
ensure => present,
}
}
httpd_mod { 'proxy_http':
ensure => present,
if !defined(Mod['proxy_http']) {
httpd::mod { 'proxy_http':
ensure => present,
}
}
file { '/etc/apache2':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
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':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/etherpad_lite/apache-connection-tuning',
notify => Service['httpd'],
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/etherpad_lite/apache-connection-tuning',
notify => Service['httpd'],
require => File['/etc/apache2/conf.d'],
}
} else {
file { '/etc/apache2/conf-available/connection-tuning.conf':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/etherpad_lite/apache-connection-tuning',
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,
owner => 'root',
group => 'root',
mode => '0644',
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,
target => '/etc/apache2/conf-available/connection-tuning.conf',
notify => Service['httpd'],
require => File['/etc/apache2/conf-available/connection-tuning.conf'],
}
httpd_mod { 'proxy_wstunnel':
ensure => present,
require => [
File['/etc/apache2/conf-enabled'],
File['/etc/apache2/conf-available/connection-tuning'],
],
}
}