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 54b08af
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions manifests/vhosts.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 - this could could be used 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 54b08af

Please sign in to comment.