summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Stanley <fungi@yuggoth.org>2015-08-20 14:39:25 +0000
committerYolanda Robla <yolanda.robla-mota@hp.com>2015-10-09 17:52:55 +0200
commit86d9628a5a79aebd6b58d61b35f2439e2ce08700 (patch)
tree23a17b00a06ff527bb108ef4e7da4e4c3592f182
parent957ecb6ceffd3180bc6c53b2abf77eddc3090b9d (diff)
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
Notes
Notes (review): Code-Review+2: Jeremy Stanley <fungi@yuggoth.org> Code-Review+2: yolanda.robla <yroblamo@redhat.com> Code-Review+1: Clint Adams <clint@gcfm.net> Workflow+1: yolanda.robla <yroblamo@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 11 Mar 2016 19:12:04 +0000 Reviewed-on: https://review.openstack.org/215169 Project: openstack-infra/puppet-ethercalc Branch: refs/heads/master
-rw-r--r--manifests/apache.pp83
1 files changed, 59 insertions, 24 deletions
diff --git a/manifests/apache.pp b/manifests/apache.pp
index 2a4e887..faae63c 100644
--- a/manifests/apache.pp
+++ b/manifests/apache.pp
@@ -24,43 +24,78 @@ class etherpad_lite::apache (
24 template => 'etherpad_lite/etherpadlite.vhost.erb', 24 template => 'etherpad_lite/etherpadlite.vhost.erb',
25 ssl => true, 25 ssl => true,
26 } 26 }
27 httpd_mod { 'rewrite': 27
28 ensure => present, 28 if !defined(Mod['rewrite']) {
29 httpd::mod { 'rewrite':
30 ensure => present,
31 }
29 } 32 }
30 httpd_mod { 'proxy': 33 if !defined(Mod['proxy']) {
31 ensure => present, 34 httpd::mod { 'proxy':
35 ensure => present,
36 }
32 } 37 }
33 httpd_mod { 'proxy_http': 38 if !defined(Mod['proxy_http']) {
34 ensure => present, 39 httpd::mod { 'proxy_http':
40 ensure => present,
41 }
35 } 42 }
36 43
44 file { '/etc/apache2':
45 ensure => directory,
46 owner => 'root',
47 group => 'root',
48 mode => '0755',
49 }
37 if ($::lsbdistcodename == 'precise') { 50 if ($::lsbdistcodename == 'precise') {
51 file { '/etc/apache2/conf.d':
52 ensure => directory,
53 owner => 'root',
54 group => 'root',
55 mode => '0755',
56 require => File['/etc/apache2'],
57 }
38 file { '/etc/apache2/conf.d/connection-tuning': 58 file { '/etc/apache2/conf.d/connection-tuning':
39 ensure => present, 59 ensure => present,
40 owner => 'root', 60 owner => 'root',
41 group => 'root', 61 group => 'root',
42 mode => '0644', 62 mode => '0644',
43 source => 'puppet:///modules/etherpad_lite/apache-connection-tuning', 63 source => 'puppet:///modules/etherpad_lite/apache-connection-tuning',
44 notify => Service['httpd'], 64 notify => Service['httpd'],
65 require => File['/etc/apache2/conf.d'],
45 } 66 }
46 } else { 67 } else {
47 file { '/etc/apache2/conf-available/connection-tuning.conf': 68 file { '/etc/apache2/conf-available':
48 ensure => present, 69 ensure => directory,
49 owner => 'root', 70 owner => 'root',
50 group => 'root', 71 group => 'root',
51 mode => '0644', 72 mode => '0755',
52 source => 'puppet:///modules/etherpad_lite/apache-connection-tuning', 73 require => File['/etc/apache2'],
74 }
75 file { '/etc/apache2/conf-available/connection-tuning':
76 ensure => present,
77 owner => 'root',
78 group => 'root',
79 mode => '0644',
80 source => 'puppet:///modules/etherpad_lite/apache-connection-tuning',
81 require => File['/etc/apache2/conf-available'],
53 } 82 }
54 83
55 file { '/etc/apache2/conf-enabled/connection-tuning.conf': 84 file { '/etc/apache2/conf-enabled':
85 ensure => directory,
86 owner => 'root',
87 group => 'root',
88 mode => '0755',
89 require => File['/etc/apache2'],
90 }
91 file { '/etc/apache2/conf-enabled/connection-tuning':
56 ensure => link, 92 ensure => link,
57 target => '/etc/apache2/conf-available/connection-tuning.conf', 93 target => '/etc/apache2/conf-available/connection-tuning.conf',
58 notify => Service['httpd'], 94 notify => Service['httpd'],
59 require => File['/etc/apache2/conf-available/connection-tuning.conf'], 95 require => [
60 } 96 File['/etc/apache2/conf-enabled'],
61 97 File['/etc/apache2/conf-available/connection-tuning'],
62 httpd_mod { 'proxy_wstunnel': 98 ],
63 ensure => present,
64 } 99 }
65 } 100 }
66 101