Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Puppet: Create an Defined Resource Type (vhost.pp)
# Define
define apache::vhost (
$port,
$docroot,
$servername = $title,
$vhost_name = '*'
) {
include apache # contains Package['httpd'] and Service['httpd']
include apache::params # contains common config settings
$vhost_dir = $apache::params::vhost_dir
file { "${vhost_dir}/${servername}.conf":
content => template('apache/vhost-default.conf.erb'),
# This template can access all of the parameters and variables from above.
owner => 'www',
group => 'www',
mode => '644',
require => Package['httpd'],
notify => Service['httpd'],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.