Re: [Puppet Users] generate function not working within conditional?

2013-01-16 Thread jcbollinger
On Wednesday, January 16, 2013 11:06:49 AM UTC-6, Jakov Sosic wrote: > > On 01/16/2013 04:30 PM, jcbollinger wrote: > [...] > > That would be less ambiguous. If you filed an RFE against the docs for > > this then I think it would be very likely to be accepted and implemented > > quickly. > >

Re: [Puppet Users] generate function not working within conditional?

2013-01-16 Thread Jakov Sosic
On 01/16/2013 04:30 PM, jcbollinger wrote: > I can understand that interpretation, but again, if you take it that way > then you have to assume that generate() will only ever return 0 (because > any other exit code of the underlying command is documented to cause a > parse error). Yea, I know. >

Re: [Puppet Users] generate function not working within conditional?

2013-01-16 Thread jcbollinger
On Tuesday, January 15, 2013 11:30:10 AM UTC-6, Jakov Sosic wrote: > > > Hm, it's maybe only me, but result of the command associates me with > exit codes, not with actual output. > I can understand that interpretation, but again, if you take it that way then you have to assume that generate

Re: [Puppet Users] generate function not working within conditional?

2013-01-15 Thread Jakov Sosic
On 01/15/2013 04:58 PM, jcbollinger wrote: > That already seems pretty clear to me in the existing docs: > > Calls an external command on the Puppet master and *returns the results > of the command*. > (Emphasis added.) How would you suggest improving that? Hm, it's maybe only me, but result o

Re: [Puppet Users] generate function not working within conditional?

2013-01-15 Thread jcbollinger
On Monday, January 14, 2013 10:38:33 AM UTC-6, Jakov Sosic wrote: > > > I guess a fix in the documentation of generate() function, explaining > what function returns to puppet DSL would be a good addition... > That already seems pretty clear to me in the existing docs: Calls an external comm

Re: [Puppet Users] generate function not working within conditional?

2013-01-14 Thread Jakov Sosic
On 01/14/2013 05:28 PM, Jakov Sosic wrote: > On 01/14/2013 04:57 PM, Jakov Sosic wrote: >> Hi, >> >> could this be a bug? >> > > OK I've figured it out... If I look at puppet code, in the file: > > /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/generate.rb > > it seems that generate() doesn

Re: [Puppet Users] generate function not working within conditional?

2013-01-14 Thread Jakov Sosic
On 01/14/2013 04:57 PM, Jakov Sosic wrote: > Hi, > > could this be a bug? > OK I've figured it out... If I look at puppet code, in the file: /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/generate.rb it seems that generate() doesn't return anything :-/ So "if" in this case doesn't make

Re: [Puppet Users] generate() function help

2012-12-28 Thread Jakov Sosic
On 12/28/2012 12:37 AM, Jakov Sosic wrote: I've found that already. But I've decided to write my own function which returns path to current module directory. If that doesn't succeed then I'll use get_module_path. Hm, I'm having problems with writing custom functions... One question first - is

Re: [Puppet Users] generate() function help

2012-12-27 Thread Jakov Sosic
On 12/27/2012 07:57 PM, Nan Liu wrote: On Thu, Dec 27, 2012 at 10:29 AM, Jakov Sosic mailto:jso...@srce.hr>> wrote: I want to run script which is distributed with my module, but the problem is I have to then hardcode the path to the script in the generate function call, for example:

Re: [Puppet Users] generate() function help

2012-12-27 Thread Nan Liu
On Thu, Dec 27, 2012 at 10:29 AM, Jakov Sosic wrote: > I want to run script which is distributed with my module, but the problem > is I have to then hardcode the path to the script in the generate function > call, for example: > > generate("/etc/puppet/**environments/${environment}/** > modules/m

Re: [Puppet Users] generate function

2011-08-10 Thread Scott Smith
Sounds like a job better suited for ENC/inventory. IMO. On Wed, Aug 10, 2011 at 2:13 PM, Craig White wrote: > > On Aug 10, 2011, at 11:50 AM, Daniel Pittman wrote: > > > On Wed, Aug 10, 2011 at 18:31, Craig White > wrote: > >> > >> what I am trying to do is execute a shell script on the puppetm

Re: [Puppet Users] generate function

2011-08-10 Thread Craig White
On Aug 10, 2011, at 11:50 AM, Daniel Pittman wrote: > On Wed, Aug 10, 2011 at 18:31, Craig White wrote: >> >> what I am trying to do is execute a shell script on the puppetmaster... >> essentially add 'host' attribute to specific ldap users. That's why the >> command has parameters... >> >>

Re: [Puppet Users] generate function

2011-08-10 Thread Daniel Pittman
On Wed, Aug 10, 2011 at 18:31, Craig White wrote: > > On Aug 10, 2011, at 11:14 AM, Daniel Pittman wrote: > >> On Wed, Aug 10, 2011 at 17:56, Craig White wrote: >>> On Aug 10, 2011, at 9:52 AM, Daniel Pittman wrote: On Wed, Aug 10, 2011 at 16:40, Craig White wrote: > Seems I don't

Re: [Puppet Users] generate function

2011-08-10 Thread Craig White
On Aug 10, 2011, at 11:14 AM, Daniel Pittman wrote: > On Wed, Aug 10, 2011 at 17:56, Craig White wrote: >> On Aug 10, 2011, at 9:52 AM, Daniel Pittman wrote: >>> On Wed, Aug 10, 2011 at 16:40, Craig White wrote: >>> Seems I don't quite understand how it's supposed to work At the mome

Re: [Puppet Users] generate function

2011-08-10 Thread Daniel Pittman
On Wed, Aug 10, 2011 at 17:56, Craig White wrote: > On Aug 10, 2011, at 9:52 AM, Daniel Pittman wrote: >> On Wed, Aug 10, 2011 at 16:40, Craig White wrote: >> >>> Seems I don't quite understand how it's supposed to work >>> At the moment, I have it inside a 'file' resource >>> >>> content => gene

Re: [Puppet Users] generate function

2011-08-10 Thread Craig White
On Aug 10, 2011, at 9:52 AM, Daniel Pittman wrote: > On Wed, Aug 10, 2011 at 16:40, Craig White wrote: > >> Seems I don't quite understand how it's supposed to work >> At the moment, I have it inside a 'file' resource >> >> content => generate("/etc/puppet/scripts/ldap-add-host.sh $fqdn admins

Re: [Puppet Users] generate function

2011-08-10 Thread Daniel Pittman
On Wed, Aug 10, 2011 at 16:40, Craig White wrote: > Seems I don't quite understand how it's supposed to work > At the moment, I have it inside a 'file' resource > > content => generate("/etc/puppet/scripts/ldap-add-host.sh $fqdn admins_all"), generate("/etc/puppet/scripts/ldap-add-hosh.sh", $fqd