Skip to content

Commit

Permalink
add param to class apache::vhosts
Browse files Browse the repository at this point in the history
this add the possibility to pass vhosts_defaults to the class for enforcing some site-wide vhost stanards
e.g. via Hiera or to significantly shorten the content of  on nodes hosting many vhosts (puppetlabs#2325)
  • Loading branch information
Jan Sellmann committed Sep 15, 2023
1 parent abb8410 commit 8b00440
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions manifests/vhosts.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @summary
# Creates `apache::vhost` defined types.
#
#
# @note See the `apache::vhost` defined type's reference for a list of all virtual
# host parameters or Configuring virtual hosts in the README section.
#
Expand All @@ -13,14 +13,31 @@
# },
# },
# }
#
# @example To create a [name-based virtual host](https://httpd.apache.org/docs/current/vhosts/name-based.html) `custom_vhost_1` using vhosts_defaults
# class { 'apache::vhosts':
# vhosts_defaults => {
# 'access_log_format' => 'noip',
# 'priority' => false,
# },
# vhosts => {
# 'custom_vhost_1' => {
# 'docroot' => '/var/www/custom_vhost_1',
# 'port' => 81,
# },
# },
# }
# @param vhosts
# A hash, where the key represents the name and the value represents a hash of
# A hash, where the key represents the name and the value represents a hash of
# `apache::vhost` defined type's parameters.
# @param vhosts_defaults
# A hash of `apache::vhost` defined type's parameters used as defaults for one
# or more vhosts - use this parameter to set vhosts_defaults on nodes with
# many vhosts or ensure site-wide vhosts_defaults in Hiera
#
class apache::vhosts (
Hash $vhosts = {},
Hash $vhosts = {},
Hash $vhosts_defaults = {},
) {
include apache
create_resources('apache::vhost', $vhosts)
create_resources('apache::vhost', $vhosts, $vhosts_defaults)
}

0 comments on commit 8b00440

Please sign in to comment.