Re: [Puppet Users] newly added ruby function executes on the server instead of the node

2012-04-05 Thread Christopher Wood
On Thu, Apr 05, 2012 at 07:14:10PM +, Nan Liu wrote: > On Thu, Apr 5, 2012 at 7:06 PM, vicki wrote: > > Hi, > > 1) I added this test function tom my > > /etc/puppet/modules/write_line_to_file/lib/puppet/parser/functions/write_line_to_file.rb > > : > > > > module Puppet::Parser::Functions newfu

Re: [Puppet Users] newly added ruby function executes on the server instead of the node

2012-04-05 Thread Nan Liu
On Thu, Apr 5, 2012 at 7:06 PM, vicki wrote: > Hi, > 1) I added this test function tom my > /etc/puppet/modules/write_line_to_file/lib/puppet/parser/functions/write_line_to_file.rb > : > > module Puppet::Parser::Functions newfunction(:write_line_to_file) do |args| >     filename = args[0] >     st

[Puppet Users] newly added ruby function executes on the server instead of the node

2012-04-05 Thread vicki
Hi, 1) I added this test function tom my /etc/puppet/modules/write_line_to_file/lib/puppet/parser/functions/write_line_to_file.rb : *module Puppet::Parser::Functions newfunction(:write_line_to_file) do |args| filename = args[0] str = args[1] File.open(args[0], 'a') {|fd| fd.puts str