Hey there,
On 01/10/15 10:27 AM, Ugo Bellavance wrote:
> I adapted the apache module for my needs and use it to create vhosts.
>
> Declaration example:
>
> apache::vhost { 'cust1-user1app1' :
> client => 'cust1,
> envstage => 'dev',
> application => 'app1',
> devuser => 'user1',
> vhost_name => "${name}",
> }
$name and $title have different values depending on the context in which
they are used.
in the declaration above, you are not within the context of
apache::vhost, but rather in the context surrounding it (maybe the node?
hence why $name would be the host name?)
$name will have the value that you would expect it to have if you were
in the "define". e.g.:
define apache::vhost ( $client, $envstage, $application, $devuser,
$vhost_name) {
notify { "${name} here will have the name of the resource, so in your
case it should be 'cust1-user1app1'": }
}
If you want to have the same value as the resource name be given to a
parameter you need to repeat that value. So you can use a variable like so:
$new_vhost = 'cust1-user1app1'
apache::vhost { $new_vhost:
# ...
vhost_name => $new_vhost,
}
--
Gabriel Filion