Skip to content

Commit

Permalink
allow specifying custom parameters to apache::vhost
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Nov 13, 2023
1 parent d83836e commit b60d8dc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4984,6 +4984,7 @@ The following parameters are available in the `zabbix::web` class:
* [`saml_settings`](#-zabbix--web--saml_settings)
* [`puppetgem`](#-zabbix--web--puppetgem)
* [`manage_selinux`](#-zabbix--web--manage_selinux)
* [`apache_vhost_custom_params`](#-zabbix--web--apache_vhost_custom_params)

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

Expand Down Expand Up @@ -5409,6 +5410,14 @@ Whether we should manage SELinux rules.

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

##### <a name="-zabbix--web--apache_vhost_custom_params"></a>`apache_vhost_custom_params`

Data type: `Hash[String[1], Any]`

Additional parameters to pass to apache::vhost.

Default value: `{}`

### <a name="zabbix--zabbixapi"></a>`zabbix::zabbixapi`

This will install the zabbixapi gem.
Expand Down
3 changes: 3 additions & 0 deletions manifests/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
# @param saml_settings A hash of additional SAML SSO settings.
# @param puppetgem Provider for the zabbixapi gem package.
# @param manage_selinux Whether we should manage SELinux rules.
# @param apache_vhost_custom_params Additional parameters to pass to apache::vhost.
# @example For multiple host setup:
# node 'wdpuppet02.dj-wasabi.local' {
# class { 'apache':
Expand Down Expand Up @@ -143,6 +144,7 @@
Hash[String[1], Variant[ScalarData, Hash]] $saml_settings = $zabbix::params::saml_settings,
$puppetgem = $zabbix::params::puppetgem,
Boolean $manage_selinux = $zabbix::params::manage_selinux,
Hash[String[1], Any] $apache_vhost_custom_params = {},
) inherits zabbix::params {
# check osfamily, Arch is currently not supported for web
if $facts['os']['family'] in ['Archlinux', 'Gentoo',] {
Expand Down Expand Up @@ -417,6 +419,7 @@
ssl_cipher => $apache_ssl_cipher,
ssl_chain => $apache_ssl_chain,
require => Package[$zabbix_web_package],
* => $apache_vhost_custom_params,
}
} # END if $manage_vhost

Expand Down
10 changes: 10 additions & 0 deletions spec/classes/web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ class { 'apache':
)
}
end

describe 'with custom vhost params' do
let :params do
super().merge(
apache_vhost_custom_params: {'mdomain': true}

Check failure on line 280 in spec/classes/web_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Layout/SpaceInsideHashLiteralBraces: Space inside { missing. (https://rubystyle.guide#spaces-braces)

Check failure on line 280 in spec/classes/web_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Lint/SymbolConversion: Unnecessary symbol conversion; use `mdomain:` instead.

Check failure on line 280 in spec/classes/web_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Layout/SpaceInsideHashLiteralBraces: Space inside } missing. (https://rubystyle.guide#spaces-braces)
)
end

it { is_expected.to contain_apache__vhost('zabbix.example.com').with_mdomain(true) }
end
end
end
end
Expand Down

0 comments on commit b60d8dc

Please sign in to comment.