RijilV wrote:
> 
> 2009/3/9 Steve Wray <[email protected] <mailto:[email protected]>>
> 
> 
>     I want to stop ntpd on all domU and openvz virtual machines while
>     enabling
>     it on all dom0 and physical machines.
> 
>     I've been trying to get my head around this and searched through
>     documentation and examples but cannot find anything like this so far.
> 
>     If its running Debian Sarge then the init script is
>     /etc/init.d/ntp-server
> 
>     If its running Etch or Lenny then its /etc/init.d/ntp
> 
>     I'd thought that the "name" variable of 'service' was supposed to
>     indicate
>     this? Or have I got my conditionals way wrong? Because the code I've
>     included doesn't seem to do anything at all. Not even a syntax error...
> 
> 
>     class services {
> 
>       service { "ntp_service":
> 
>         name => $lsbdistcodename ? {
>           'sarge' => "ntp-server",
>           'etch'  => "ntp",
>           'lenny' => "ntp",
>         },
> 
>         case $virtual {
>           'xenu','openvz':
>             {
>               ensure  => stopped,
>               enable  => false,
>               pattern => "ntpd"
>             }
>           'xen0','physical':
>             {
>               ensure  => running,
>               enable  => true,
>               pattern => "ntpd"
>             }
>         }
>       }
>     }
> 
> 
> 
> Kicks an error for me:
> 
> $ puppet --parseonly test.pp
> err: Could not parse for environment production: Syntax error at 'case'; 
> expected '}' at /raid/boaz/home/rijilv/test.pp:11
> 
> 
> How are you testing your manifests?

So far, by running them in puppet in a test environment.

In fact I grew suspicious that I wasn't getting any errors or anything... 
so I did some other tests.

What I did was take my code and comment out great chunks of it to see what 
would happen. So far the only thing that makes any difference is the first 
line. If I comment that out then I get errors from puppet, but nothing else 
seems to matter.


-- 
Please remember that an email is just like a postcard; it is not 
confidential nor private nor secure and can be read by many other people 
than the intended recipient. A postcard can be read by anyone at the mail 
sorting office and expecting what is written on it to be private and secret 
is not realistic. Please hold no higher expectation of email.

If you need to send confidential information in an email you need to use 
encryption. PGP is Pretty good for this.

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

Reply via email to