I've simplified the script to this:

#!/usr/local/bin/ruby

open('test.out', 'w') { |f|
  f.puts "Hello"
}


.. and it still gives me 'error 1' when run as an ENC. 

While it's true that the puppet server is using ruby 1.8.7 this shouldn't 
matter for the above code. 

What would the effect of outputting incorrect YAML be? I'm wondering about 
the syntax of what's being printed.




On Friday, October 31, 2014 2:44:18 AM UTC-7, Felix.Frank wrote:
>
> Well, obviously your script is throwing an error when invoked from 
> Puppet, behaving differently than from the command line. 
>
> This can have numerous reasons related to your process environment. 
> Perhaps the master is running with a different Ruby (PE?) 
>
> To debug this, add early debug logging to your ENC script and trace its 
> execution when Puppet calls it. If you fail to generate *any* log 
> output, this likely means that Ruby won't even start interpreting your 
> code. 
>
> HTH, 
> Felix 
>
> On 10/31/2014 02:20 AM, JonY wrote: 
> > Im recoding an ENC in ruby (from Perl). The new version gives me the 
> error: 
> > 
> > Oct 30 18:03:25 serv puppet-master[29051]: Failed when searching for 
> > node nodexx: Failed to find nodexx via exec: Execution of '<path-to-enc> 
> > nodexx' returned 1: 
> > 
> > What I've checked: 
> > 
> > - both can be run under the 'puppet' account ("sudo -u puppet 
> > <path-to-enc>" ) 
> > - both return (seemingly) identical YAML 
> > - both are 'chmod puppet:puppet <file>' 
> > 
> > But only the perl works... what did I miss? 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7bd78f41-04d5-4901-b147-7a7fcac99b45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to