Skip to content

Commit 8294dbc

Browse files
committed
allow specifying custom parameters to apache::vhost
1 parent d83836e commit 8294dbc

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

REFERENCE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4984,6 +4984,7 @@ The following parameters are available in the `zabbix::web` class:
49844984
* [`saml_settings`](#-zabbix--web--saml_settings)
49854985
* [`puppetgem`](#-zabbix--web--puppetgem)
49864986
* [`manage_selinux`](#-zabbix--web--manage_selinux)
4987+
* [`apache_vhost_custom_params`](#-zabbix--web--apache_vhost_custom_params)
49874988

49884989
##### <a name="-zabbix--web--zabbix_url"></a>`zabbix_url`
49894990

@@ -5409,6 +5410,14 @@ Whether we should manage SELinux rules.
54095410

54105411
Default value: `$zabbix::params::manage_selinux`
54115412

5413+
##### <a name="-zabbix--web--apache_vhost_custom_params"></a>`apache_vhost_custom_params`
5414+
5415+
Data type: `Hash[String[1], Any]`
5416+
5417+
Additional parameters to pass to apache::vhost.
5418+
5419+
Default value: `{}`
5420+
54125421
### <a name="zabbix--zabbixapi"></a>`zabbix::zabbixapi`
54135422

54145423
This will install the zabbixapi gem.

manifests/web.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
# @param saml_settings A hash of additional SAML SSO settings.
7878
# @param puppetgem Provider for the zabbixapi gem package.
7979
# @param manage_selinux Whether we should manage SELinux rules.
80+
# @param apache_vhost_custom_params Additional parameters to pass to apache::vhost.
8081
# @example For multiple host setup:
8182
# node 'wdpuppet02.dj-wasabi.local' {
8283
# class { 'apache':
@@ -143,6 +144,7 @@
143144
Hash[String[1], Variant[ScalarData, Hash]] $saml_settings = $zabbix::params::saml_settings,
144145
$puppetgem = $zabbix::params::puppetgem,
145146
Boolean $manage_selinux = $zabbix::params::manage_selinux,
147+
Hash[String[1], Any] $apache_vhost_custom_params = {},
146148
) inherits zabbix::params {
147149
# check osfamily, Arch is currently not supported for web
148150
if $facts['os']['family'] in ['Archlinux', 'Gentoo',] {
@@ -417,6 +419,7 @@
417419
ssl_cipher => $apache_ssl_cipher,
418420
ssl_chain => $apache_ssl_chain,
419421
require => Package[$zabbix_web_package],
422+
* => $apache_vhost_custom_params,
420423
}
421424
} # END if $manage_vhost
422425

spec/classes/web_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,16 @@ class { 'apache':
273273
)
274274
}
275275
end
276+
277+
describe 'with custom vhost params' do
278+
let :params do
279+
super().merge(
280+
apache_vhost_custom_params: { mdomain: true }
281+
)
282+
end
283+
284+
it { is_expected.to contain_apache__vhost('zabbix.example.com').with_mdomain(true) }
285+
end
276286
end
277287
end
278288
end

0 commit comments

Comments
 (0)