Hi there,
we have a mixed deployment of sarge, etch and now lenny servers.
The first example works:
case $lsbdistcodename {
sarge: { package { ntp: ensure => present } }
default: { package { ntp: ensure => absent } }
}
This does not:
package { ntp:
case $lsbdistcodename {
sarge: { ensure => present }
default: { ensure => absent }
}
I prefer the second one but cannot fathom why the syntax is wrong.
They seem functionally identical and I''m sure I have enough
{}''s and in the
right places...
Thanks!
--
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 puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Steve Wray wrote:> I prefer the second one but cannot fathom why the syntax is wrong.Inline syntax is a little different: package { ntp: ensure => $lsbdistcodename ? { sarge => present, default => absent, }, } Hope that helps, Avi --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Avi Miller wrote:> Steve Wray wrote: >> I prefer the second one but cannot fathom why the syntax is wrong. > > Inline syntax is a little different: > > package { ntp: > ensure => $lsbdistcodename ? { > sarge => present, > default => absent, > }, > } > > Hope that helps, > AviOhh I see :) Thanks!> > >-- 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 puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Avi Miller wrote:> Steve Wray wrote: >> I prefer the second one but cannot fathom why the syntax is wrong. > > Inline syntax is a little different: > > package { ntp: > ensure => $lsbdistcodename ? { > sarge => present, > default => absent, > }, > } > > Hope that helps,How about multiple conditions? Eg if I want ntp to not be installed on virtual machines unless they are running sarge? This gets me installed if its sarge: package { ntp-simple: ensure => $lsbdistcodename? { ''sarge'' => present, default => absent } } This gets me installed if its xen: package { ntp-simple: ensure => $virtual? { ''xenu'' => present, ''xen0'' => present, default => absent } } How do I combine these? I''ve tried various permutations and had no luck. and I don''t see any obvious examples of what I''m trying to do. --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
I have found something like this works:
package { libc6-xen:
ensure => $lsbdistcodename? {
''sarge'' => absent,
default =>
$virtual? {
''xenu'' => present,
''xen0'' => present,
''openvz'' => absent,
''physical'' => absent,
default => present
}
}
}
but its so ugly I can''t believe I''ve stumbled upon the correct
way of doing
this :)
Also, the ''package'' thing... I need it to be totally ignored
on sarge
machines; as it stands when puppetd runs I get an error on sarge servers:
"No packages found matching libc6-xen.''
which is right... there is no libc6-xen on sarge.
I''m a little surprised as it seems that ''absent''
actually checks whether
the package is available at all? Or is my conditional faulty?
Steve Wray wrote:> Avi Miller wrote:
>> Steve Wray wrote:
>>> I prefer the second one but cannot fathom why the syntax is wrong.
>> Inline syntax is a little different:
>>
>> package { ntp:
>> ensure => $lsbdistcodename ? {
>> sarge => present,
>> default => absent,
>> },
>> }
>>
>> Hope that helps,
>
>
> How about multiple conditions? Eg if I want ntp to not be installed on
> virtual machines unless they are running sarge?
>
> This gets me installed if its sarge:
>
> package { ntp-simple:
> ensure => $lsbdistcodename? { ''sarge'' =>
present, default => absent }
> }
>
> This gets me installed if its xen:
> package { ntp-simple:
> ensure => $virtual? {
> ''xenu'' => present,
> ''xen0'' => present,
> default => absent
> }
> }
>
> How do I combine these? I''ve tried various permutations and had no
luck.
> and I don''t see any obvious examples of what I''m trying
to do.
>
>
> >
--
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 puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---