Hi friends, I''m writing custom function. When i run it with the command *puppet --verbose --modulepath=`pwd` ./site.pp * It run as i expected But when i run *puppetmasterd site.pp --modulepath=`pwd`* after that, i run: *puppetd --server puppet -w 60 --test --modulepath=`pwd` --debug* It run, but only run the native function of puppet. It doesn''t run my custom function, and doesn''t have any error I think my custom function haven''t yet loaded when i run puppetmasterd Any body can help me? Thanks in advance. Best regards, TungDH --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On May 23, 2008, at 2:34 AM, tung dang wrote:> Hi friends, > I''m writing custom function. > > When i run it with the command > puppet --verbose --modulepath=`pwd` ./site.pp > It run as i expected > > But when i run > puppetmasterd site.pp --modulepath=`pwd` > after that, i run: > puppetd --server puppet -w 60 --test --modulepath=`pwd` --debug > It run, but only run the native function of puppet. It doesn''t run > my custom function, and doesn''t have any error > > I think my custom function haven''t yet loaded when i run puppetmasterd > Any body can help me?Do you get an exception when you run the manifest? Are you actually running puppetmasterd like the above? You should be doing something like: puppetmasterd --manifest site.pp --modulepath=$PWD -- You can''t have everything. Where would you put it? -- Stephen Wright --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thank Luke Kanies for your reply I have done like that. And have done as you suggest. But no any change appeared. No exception appeared. I run command in /etc/puppet/manifests. My function is putted in /etc/puppet/manifests/modules/lib/puppet/parser/functions/write_line_to_function.rb *The content of write_line_to_function file: **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 } print args[1] end end** **The site.pp file: **class c { notify {"Hello puppet":} write_line_to_file(''/tmp/test'', "Hello world!\n") } node default { include c }** * *The log information in the console when i run puppet* *root@tungdh-desktop:/etc/puppet/manifests# puppet --verbose --modulepath=$PWD site.pp Hello world! notice: Hello puppet* ==> It''s OK, "Hello world" is written to /tmp/test file *When i run puppetmasterd, after that run puppetd* *root@tungdh-desktop:/etc/puppet/manifests# puppetd --server puppet -w 60 --test --modulepath=$PWD notice: Ignoring cache info: Caching catalog at /var/lib/puppet/state/localconfig.yaml notice: Starting catalog run notice: Hello puppet notice: Finished catalog run in 0.02 seconds* ==> Not OK, "Hello world" is not written to /tmp/test file I don''t know what problem is. Can you help me? Thank for your support Best regards, TungDH * * --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On May 25, 2008, at 9:41 PM, tung dang wrote:> When i run puppetmasterd, after that run puppetd > root@tungdh-desktop:/etc/puppet/manifests# puppetd --server puppet - > w 60 --test --modulepath=$PWD > notice: Ignoring cache > info: Caching catalog at /var/lib/puppet/state/localconfig.yaml > notice: Starting catalog run > notice: Hello puppet > notice: Finished catalog run in 0.02 seconds > ==> Not OK, "Hello world" is not written to /tmp/test file > > I don''t know what problem is. Can you help me?Check the server; functions run on the server, not on the client. -- Susskind''s Rule of Thumb: Don''t ask what they think. Ask what they do. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thank Luke Kanies for your reply, But i run puppetmasterd and puppetd on 1 PC. And i have just tested in 2 PC with the similar commands above, it has the same result as above Do i need any other configure here ? Thank in advance TungDH --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On May 25, 2008, at 11:39 PM, tung dang wrote:> Thank Luke Kanies for your reply, > But i run puppetmasterd and puppetd on 1 PC. And i have just tested > in 2 PC with the similar commands above, it has the same result as > above > Do i need any other configure here ?Everything looks right, but you must be just missing something. I''d play with it some more and see what you can find. It looks like you''ve got it configured correctly, so it''s a question of tracking down whatever the problem is. -- What happens to the hole when the cheese is gone? -- Bertolt Brecht --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Can you suggest for me the way to find my problem? In the debug monitor, i don''t see any information about my custom function, and don''t have any error or warning It seemly ignore my custom function --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---