Skip to content

Commit cf0c4c4

Browse files
committed
Stricter data type on apache::vhost::jk_mounts
This also pulls in mod_jk if needed.
1 parent 57f194e commit cf0c4c4

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',
@@ -2902,7 +2902,9 @@
29022902

29032903
# Template uses:
29042904
# - $jk_mounts
2905-
if $jk_mounts and ! empty($jk_mounts) {
2905+
if !empty($jk_mounts) and $ensure == 'present' {
2906+
include apache::mod::jk
2907+
29062908
concat::fragment { "${name}-jk_mounts":
29072909
target => "${priority_real}${filename}.conf",
29082910
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)