Does it work if you change to

if ( $::smcvhost == 'belleville' ) or ( $::smcvhost == 'all' ) {

?

Alex

On Aug 12, 2:34 pm, Antoine Benkemoun <antoine.benkem...@gmail.com>
wrote:
> Hello,
>
> First of all, thank you for making the awesome piece of software that is
> Puppet. I have working with it for a week and I'm really liking what I'm
> seeing and I have been able to do quite a few tasks with ease. Currently, I
> am trying to configure Apache Virtual Hosts with Puppet and have been trying
> different things with little success.
>
> I have defined a node as the following :
>
>     node 'test1.cob' inherits serveurClient {
>             $smcvhost = 'all'
>     }
>
> The serveurClient class includes the apache class. This works fine as Apache
> gets installed and all the configuration gets applied correctly, except the
> virtual hosts.
>
> The configuration relating to the virtual hosts is the following :
>
>     class apache::config {
>         File{
>             require => Class["apache::install"],
>             notify  => Class["apache::service"],
>              ensure  => present,
>             owner   => "www-data",
>             group   => "www-data",
>             mode    => 755
>         }
>         ...
>         if ( $smcvhost == 'belleville' ) or ( $smcvhost == 'all' ) {
>             apache::smcvhost{'belleville':
>                 client => 'belleville',
>             }
>         }
>         ...
>     }
>
> The *apache::smcvhost* definition works correctly because if I specify it
> directly in the node without the condition, the virtual host gets created
> correctly with no errors. If I remove the if statement, it will also get
> created correctly. I have tried only specifying the second condition but
> that did not make it work.
>
> When this fails to be executed, I do not get any error. The puppet report
> just ignores this configuration part.
>
> I am thinking that this is some sort of variable scoping problem but from
> what I have read, this practice seems correct and I imagine puppet would
> give me some error if I tried to evaluate a non-existing variable.
>
> Thank you in advance for your help,
>
> Antoine

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to