Skip to content

Commit f73fdcc

Browse files
committed
Stricter data type on apache::vhost::jk_mounts
This also pulls in mod_jk if needed.
1 parent 88d7b26 commit f73fdcc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

manifests/vhost.pp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@
19581958
Optional[Variant[Hash, Array]] $modsec_disable_msgs = undef,
19591959
Optional[Variant[Hash, Array]] $modsec_disable_tags = undef,
19601960
Optional[String] $modsec_body_limit = undef,
1961-
Optional[Array[Hash]] $jk_mounts = undef,
1961+
Array[Hash] $jk_mounts = [],
19621962
Boolean $auth_kerb = false,
19631963
Enum['on', 'off'] $krb_method_negotiate = 'on',
19641964
Enum['on', 'off'] $krb_method_k5passwd = 'on',
@@ -2898,7 +2898,9 @@
28982898

28992899
# Template uses:
29002900
# - $jk_mounts
2901-
if $jk_mounts and ! empty($jk_mounts) {
2901+
if !empty($jk_mounts) and $ensure == 'present' {
2902+
include apache::mod::jk
2903+
29022904
concat::fragment { "${name}-jk_mounts":
29032905
target => "${priority_real}${filename}.conf",
29042906
order => 340,

templates/vhost/_jk_mounts.erb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
<% if @jk_mounts and not @jk_mounts.empty? -%>
1+
<% unless @jk_mounts.empty? -%>
22

33
<%- @jk_mounts.each do |jk| -%>
4-
<%- if jk.is_a?(Hash) -%>
5-
<%- if jk.has_key?('mount') and jk.has_key?('worker') -%>
4+
<%- if jk.has_key?('mount') and jk.has_key?('worker') -%>
65
JkMount <%= jk['mount'] %> <%= jk['worker'] %>
7-
<%- elsif jk.has_key?('unmount') and jk.has_key?('worker') -%>
6+
<%- elsif jk.has_key?('unmount') and jk.has_key?('worker') -%>
87
JkUnMount <%= jk['unmount'] %> <%= jk['worker'] %>
9-
<%- end -%>
108
<%- end -%>
119
<%- end -%>
1210
<% end -%>

0 commit comments

Comments
 (0)