Re: [Puppet Users] OS Conditional exec.

2010-04-27 Thread R.I.Pienaar
On 27 Apr 2010, at 02:37, Ohad Levy wrote: > AFAIK, it does get evaluated each time :) When I first did extlookup i tried to set the look up order using normal vars like below in site.pp $extlookup_precedence = ["$fqdn"] This failed on 24 it would get blanks or wrong ones Maybe it's fixed

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Ohad Levy
On Tue, Apr 27, 2010 at 1:03 AM, R.I.Pienaar wrote: > > puppet really needs a downcase function. > > -- > > module Puppet::Parser::Functions newfunction(:downcase, :type => :rvalue) do |args| args[0].downcase end end Ohad -- You received this message because yo

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Ohad Levy
AFAIK, it does get evaluated each time :) On Tue, Apr 27, 2010 at 8:02 AM, James Turnbull wrote: > On 27/04/2010 2:17 AM, R.I.Pienaar wrote: > >> >> - "Douglas Garstang" wrote: >> >> I wasn't able to get this to run for only CentOS. I tried a few >>> different things in the site.pp. I wish

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread James Turnbull
On 27/04/2010 2:17 AM, R.I.Pienaar wrote: - "Douglas Garstang" wrote: I wasn't able to get this to run for only CentOS. I tried a few different things in the site.pp. I wish I could put a case statement site.pp is a special file, it doesn't get evaluated on every run the same way that

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Peter Meier
Your site.pp should look like:  include os::setup  Package {    require => Class["os::setup"]  } other wise the classes is not avaiable, how should puppet set a relation to something that is not included in its manifests? Oh, well... that's also ugly. :( what? -- You received this message b

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 10:51 AM, Peter Meier wrote: > Your site.pp should look like: > >  include os::setup >  Package { >    require => Class["os::setup"] >  } > > other wise the classes is not avaiable, how should puppet set a relation to > something that is not included in its manifests? Oh,

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Peter Meier
Your site.pp should look like: include os::setup Package { require => Class["os::setup"] } other wise the classes is not avaiable, how should puppet set a relation to something that is not included in its manifests? cheers pete -- You received this message because you are subscrib

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 10:45 AM, R.I.Pienaar wrote: > > - "Douglas Garstang" wrote: >> So, apparently the net-snmp module can't find os::setup class. Not >> sure why... > > you need to include it somewhere first. > > most people have some kind of common class they include on all machines, >

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread R.I.Pienaar
- "Alan Barrett" wrote: > On Mon, 26 Apr 2010, R.I.Pienaar wrote: > > puppet really needs a downcase function. > > $var = "Mixed CaSe sTUff" > $downcased_var = inline_template("<%= var.downcase %>") obvious, and obviously ugly :) -- You received this message because you are subscribed to

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread R.I.Pienaar
- "Douglas Garstang" wrote: > So, apparently the net-snmp module can't find os::setup class. Not > sure why... you need to include it somewhere first. most people have some kind of common class they include on all machines, you'd include it there -- R.I.Pienaar -- You received this mes

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Alan Barrett
On Mon, 26 Apr 2010, R.I.Pienaar wrote: > puppet really needs a downcase function. $var = "Mixed CaSe sTUff" $downcased_var = inline_template("<%= var.downcase %>") --apb (Alan Barrett) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post t

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 10:23 AM, Douglas Garstang wrote: > On Mon, Apr 26, 2010 at 10:20 AM, R.I.Pienaar wrote: >>> and I include it in every single module (shame I can't include it at >>> site.pp). As far as I know, including one class in another does not >>> guarantee that the other class gets

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Peter Meier
Well that's weird and mildly confusing. The class is opsys::centos but we're really including opsys::CentOS. Nice. because puppet can't have any classes started with capitalized letters (global resource identifier clash) and anything else behind is anyway downcased (class tEST == class test)

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 10:20 AM, R.I.Pienaar wrote: >> and I include it in every single module (shame I can't include it at >> site.pp). As far as I know, including one class in another does not >> guarantee that the other class gets evaluated first, even though the >> other class has a default P

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread R.I.Pienaar
> and I include it in every single module (shame I can't include it at > site.pp). As far as I know, including one class in another does not > guarantee that the other class gets evaluated first, even though the > other class has a default Package{} or does it? Docs on this > stuff in puppet a

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread R.I.Pienaar
- "Peter Meier" wrote: > > right, classes cant have Caps as the first char (or maybe even > > anywhere? not sure). > > > > anyway, you'd probably need to look at a case statement then that > > includes opsys::centos for $operatingsystem == CentOS and similar > > for your other operatin

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 10:03 AM, R.I.Pienaar wrote: > > - "Douglas Garstang" wrote: > >> Apr 26 09:58:15 s_...@app09.fr.xxx.com puppetd[12785]: Could not >> retrieve catalog: Syntax error at '::CentOS' at >> /etc/puppet/modules/opsys/manifests/init.pp:1 on node >> app09.fr.xxx.com >> >> wher

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Peter Meier
right, classes cant have Caps as the first char (or maybe even anywhere? not sure). anyway, you'd probably need to look at a case statement then that includes opsys::centos for $operatingsystem == CentOS and similar for your other operating systems. :( puppet does that already for us: $

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 10:02 AM, Peter Meier wrote: >> class opsys::CentOS { > >  class opsys::centos { But... app09 ~:# facter | grep "operatingsystem =>" operatingsystem => CentOS facter reports CentOS, not centos Doug. -- You received this message because you are subscribed to the Google

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread R.I.Pienaar
- "Douglas Garstang" wrote: > Apr 26 09:58:15 s_...@app09.fr.xxx.com puppetd[12785]: Could not > retrieve catalog: Syntax error at '::CentOS' at > /etc/puppet/modules/opsys/manifests/init.pp:1 on node > app09.fr.xxx.com > > where the include has: > > include "opsys::${operatingsystem}" >

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Peter Meier
class opsys::CentOS { class opsys::centos { cheers pete -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr.

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 9:55 AM, Peter Meier wrote: > >> include opsys::$operatingsystem > > include "opsys::${operatingsystem}" Well, that's weird. Now I am getting this: Apr 26 09:58:15 s_...@app09.fr.xxx.com puppetd[12785]: Could not retrieve catalog: Syntax error at '::CentOS' at /etc/puppet

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Peter Meier
include opsys::$operatingsystem include "opsys::${operatingsystem}" cheers pete -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email t

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 9:48 AM, R.I.Pienaar wrote: > > - "Douglas Garstang" wrote: > >> include opsys::$operatingsystem > > they are, you didnt read my example properly. Ah, quotes... -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To po

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread R.I.Pienaar
- "Douglas Garstang" wrote: > include opsys::$operatingsystem they are, you didnt read my example properly. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscrib

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 9:31 AM, R.I.Pienaar wrote: > > - "Douglas Garstang" wrote: > >> On Mon, Apr 26, 2010 at 9:17 AM, R.I.Pienaar wrote: >> > >> > - "Douglas Garstang" wrote: >> > >> >> I wasn't able to get this to run for only CentOS. I tried a few >> >> different things in the sit

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 9:37 AM, Julian Simpson wrote: > >> The first poster said he would include os::centos in his module. What >> happens if the module might be running on either CentOS or Ubuntu? I >> don't think 'include os::centos' will work so great on an Ubuntu >> system. How do you make i

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread R.I.Pienaar
- "Douglas Garstang" wrote: > On Mon, Apr 26, 2010 at 9:31 AM, R.I.Pienaar wrote: > > > > - "Douglas Garstang" wrote: > > > >> On Mon, Apr 26, 2010 at 9:17 AM, R.I.Pienaar > wrote: > >> > > >> > - "Douglas Garstang" wrote: > >> > > >> >> I wasn't able to get this to run for only

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 9:31 AM, R.I.Pienaar wrote: > > - "Douglas Garstang" wrote: > >> On Mon, Apr 26, 2010 at 9:17 AM, R.I.Pienaar wrote: >> > >> > - "Douglas Garstang" wrote: >> > >> >> I wasn't able to get this to run for only CentOS. I tried a few >> >> different things in the sit

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Julian Simpson
> The first poster said he would include os::centos in his module. What > happens if the module might be running on either CentOS or Ubuntu? I > don't think 'include os::centos' will work so great on an Ubuntu > system. How do you make it dynamic? > By using the $operatingsystem variable in the in

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread R.I.Pienaar
- "Douglas Garstang" wrote: > On Mon, Apr 26, 2010 at 9:17 AM, R.I.Pienaar wrote: > > > > - "Douglas Garstang" wrote: > > > >> I wasn't able to get this to run for only CentOS. I tried a few > >> different things in the site.pp. I wish I could put a case > statement > > > > site.pp is

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 9:17 AM, R.I.Pienaar wrote: > > - "Douglas Garstang" wrote: > >> I wasn't able to get this to run for only CentOS. I tried a few >> different things in the site.pp. I wish I could put a case statement > > site.pp is a special file, it doesn't get evaluated on every run

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread R.I.Pienaar
- "Douglas Garstang" wrote: > I wasn't able to get this to run for only CentOS. I tried a few > different things in the site.pp. I wish I could put a case statement site.pp is a special file, it doesn't get evaluated on every run the same way that classes would get. So variables like $ope

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
On Mon, Apr 26, 2010 at 8:58 AM, Julian Simpson wrote: > >> I wasn't able to get this to run for only CentOS. I tried a few >> different things in the site.pp. I wish I could put a case statement >> inside the exec, but puppet doesn't like that. So, below is what I had >> originally... how can I g

Re: [Puppet Users] OS Conditional exec.

2010-04-26 Thread Julian Simpson
> I wasn't able to get this to run for only CentOS. I tried a few > different things in the site.pp. I wish I could put a case statement > inside the exec, but puppet doesn't like that. So, below is what I had > originally... how can I get the exec["yum-clean-all"] to only run for > CentOS and not

[Puppet Users] OS Conditional exec.

2010-04-26 Thread Douglas Garstang
We've been pretty much a homogenous CentOS environment until recently. Actually, we've had a mixture of CentOS, Ubuntu and Debian because a previous admin thought this would be 'fun'. G. Anyway, I tried to add an Ubuntu system for the first time. My site.pp file has a 'yum clean all' dependency