Evaluating the template from the vhost defined type rather than the
module where it originates causes problems when dereferencing the
variables in the ERB file. If they are not accessed via the internal
scope object, they can't be found when using puppet 4. The scope object
is also useless when the variables are defined in a defined type and not
a class.
This patch adds a new parameter, $content, which overrides the $template
parameter. If provided, $content indicates the literal string content
for the vhost, as opposed to a reference to a template that needs to be
rendered. This can be used like this:
$content = template('example/example.vhost.erb')
httpd::vhost { 'vhostname':
content => $content,
priority => 50
}
This way the template is evaluated when the template() function is
called and has access to variables in that scope.
Change-Id: Ibe3c609d92f3321f43f4794062a64b119b07a1d0