Skip to content

Instantly share code, notes, and snippets.

@matthewflannery
Created August 9, 2016 16:14
Show Gist options
  • Save matthewflannery/6fccb7adf4c7b5d3514073bbc0b77e83 to your computer and use it in GitHub Desktop.
Save matthewflannery/6fccb7adf4c7b5d3514073bbc0b77e83 to your computer and use it in GitHub Desktop.
Elegant way of handling multiple pool/sites IIS with Puppet
class iis_server (
$log_dir = 'E:\logs',
$app_dir = 'E:\apps',
Array[Hash] $site_instances = []
) {
# FYI, IIS allows pools of websites to be run in their own process and pool can have many sites
# IIS sites can also have many applications that run under the site context
Class['iis_server::install'] -> Class['iis_server::defaults']
include iis_server::install
class{ 'iis_server::defaults':
app_dir => $app_dir,
log_dir => $log_dir,
}
$site_instances.each | Hash $instance| {
iis_server::config{$instance['site_name']
ensure => $instance['ensure'],
application_pool_name => $instance['pool_name'],
site_name => $instance['site_name'],
application_name => $instance['application_name'],
enable_ssl => true,
web_port => $instance['web_port'],
web_root => $inet_pub_www_root,
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment