Browse Source

Use httpd::mod instead of httpd_mod

httpd::mod is a high-level wrapper around httpd_mod,
and, since it is used, e.g. in puppet-jenkins and puppet-zuul,
it should be uniform across all puppet projects,
to be able to properly detect
whether Httpd_mod instance defined, like below:

if (! defined(Httpd::Mod['rewrite'])) {
    httpd::mod { 'rewrite': ensure => present }
}

Change-Id: I2b453b6f15d80bba9b1c29bc0d35651cfae05427
Depends-On: I69e7f9c54d06d7f98b50fdc7d5a67dd10e3e0050
changes/19/253619/7
Evgeny Antyshev 3 years ago
parent
commit
4e1b8cd90a

+ 4
- 2
modules/openstack_project/manifests/cacti.pp View File

@@ -14,8 +14,10 @@ class openstack_project::cacti (
14 14
 
15 15
   include ::httpd
16 16
 
17
-  httpd_mod { 'rewrite':
18
-    ensure => present,
17
+  if ! defined(Httpd::Mod['rewrite']) {
18
+    httpd::mod { 'rewrite':
19
+        ensure => present,
20
+    }
19 21
   }
20 22
 
21 23
   package { 'cacti':

+ 4
- 2
modules/openstack_project/manifests/eavesdrop.pp View File

@@ -140,8 +140,10 @@ class openstack_project::eavesdrop (
140 140
     require => Class['statusbot'],
141 141
   }
142 142
 
143
-  httpd_mod { 'headers':
144
-    ensure => present,
143
+  if ! defined(Httpd::Mod['headers']) {
144
+    httpd::mod { 'headers':
145
+        ensure => present,
146
+    }
145 147
   }
146 148
 
147 149
   class { 'project_config':

+ 14
- 6
modules/openstack_project/manifests/grafana.pp View File

@@ -70,14 +70,22 @@ class openstack_project::grafana (
70 70
     template => 'openstack_project/grafana.vhost.erb',
71 71
   }
72 72
 
73
-  httpd_mod { 'rewrite':
74
-    ensure => present,
73
+  if ! defined(Httpd::Mod['rewrite']) {
74
+    httpd::mod { 'rewrite':
75
+        ensure => present,
76
+    }
75 77
   }
76
-  httpd_mod { 'proxy':
77
-    ensure => present,
78
+
79
+  if ! defined(Httpd::Mod['proxy']) {
80
+    httpd::mod { 'proxy':
81
+        ensure => present,
82
+    }
78 83
   }
79
-  httpd_mod { 'proxy_http':
80
-    ensure => present,
84
+
85
+  if ! defined(Httpd::Mod['proxy_http']) {
86
+    httpd::mod { 'proxy_http':
87
+        ensure => present,
88
+    }
81 89
   }
82 90
 
83 91
   class { '::project_config':

+ 14
- 6
modules/openstack_project/manifests/static.pp View File

@@ -31,14 +31,22 @@ class openstack_project::static (
31 31
   include ::httpd
32 32
   include ::httpd::mod::wsgi
33 33
 
34
-  httpd_mod { 'rewrite':
35
-    ensure => present,
34
+  if ! defined(Httpd::Mod['rewrite']) {
35
+    httpd::mod { 'rewrite':
36
+        ensure => present,
37
+    }
36 38
   }
37
-  httpd_mod { 'proxy':
38
-    ensure => present,
39
+
40
+  if ! defined(Httpd::Mod['proxy']) {
41
+    httpd::mod { 'proxy':
42
+        ensure => present,
43
+    }
39 44
   }
40
-  httpd_mod { 'proxy_http':
41
-    ensure => present,
45
+
46
+  if ! defined(Httpd::Mod['proxy_http']) {
47
+    httpd::mod { 'proxy_http':
48
+        ensure => present,
49
+    }
42 50
   }
43 51
 
44 52
   if ! defined(File['/srv/static']) {

+ 14
- 6
modules/openstack_project/manifests/status.pp View File

@@ -28,14 +28,22 @@ class openstack_project::status (
28 28
 
29 29
   include ::httpd
30 30
 
31
-  httpd_mod { 'rewrite':
32
-    ensure => present,
31
+  if ! defined(Httpd::Mod['rewrite']) {
32
+    httpd::mod { 'rewrite':
33
+        ensure => present,
34
+    }
33 35
   }
34
-  httpd_mod { 'proxy':
35
-    ensure => present,
36
+
37
+  if ! defined(Httpd::Mod['proxy']) {
38
+    httpd::mod { 'proxy':
39
+        ensure => present,
40
+    }
36 41
   }
37
-  httpd_mod { 'proxy_http':
38
-    ensure => present,
42
+
43
+  if ! defined(Httpd::Mod['proxy_http']) {
44
+    httpd::mod { 'proxy_http':
45
+        ensure => present,
46
+    }
39 47
   }
40 48
 
41 49
   file { '/srv/static':

Loading…
Cancel
Save