We have found 3 bugs we want tracked down before cutting the next Puppet RC. (2.7.7rc2) File serving performance issue with large numbers of files: https://projects.puppetlabs.com/issues/9671 Agent may crash when attempting to manage permissions on non-NTFS filesystems (on Windows) https://projects.puppetlabs.com/issues/10614 There is a pull request for this issue (binary mode on Windows) https://projects.puppetlabs.com/issues/9983 Just wanted to let everybody know, in case you''re on the edge of your seat for 2.7.7. Mike -- 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.
Marc Richman
2011-Nov-08 14:31 UTC
[Puppet Users] Using a defined function in another class?
I have a function defined in one class that I would like to use in another class, but I can not seem to get it to work, I set up a simple test case and I get the following error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type testfn at /etc/puppet/modules/sandbox/one/manifests/init.pp:3 on node bos-test01.contentstore.net /etc/puppet/modules/sandbox/one/manifests/init.pp class one { include two testfn { test:} } /etc/puppet/modules/sandbox/two/manifests/init.pp class two { define testfn () { notify {foo: } } } What am I doing wrong? Thanks Marc -- 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.
Christopher Wood
2011-Nov-08 14:37 UTC
Re: [Puppet Users] Using a defined function in another class?
Off the top of my head, untested: /etc/puppet/modules/sandbox/manifests/one.pp class sandbox::one { include sandbox::two testfn { test:} } /etc/puppet/modules/sandbox/manifests/two.pp class sandbox::two { define testfn () { notify {foo: } } } On Tue, Nov 08, 2011 at 09:31:57AM -0500, Marc Richman wrote:> I have a function defined in one class that I would like to use in another class, but I can not seem to get it to work, I set up a simple test case and I get the following error: > Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type testfn at /etc/puppet/modules/sandbox/one/manifests/init.pp:3 on node bos-test01.contentstore.net > > > /etc/puppet/modules/sandbox/one/manifests/init.pp > class one { > include two > testfn { test:} > } > > /etc/puppet/modules/sandbox/two/manifests/init.pp > class two { > define testfn () { > notify {foo: } > } > } > > What am I doing wrong? > > Thanks > Marc > > -- > 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. > >-- 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.
Marc Richman
2011-Nov-08 15:01 UTC
RE: [Puppet Users] Using a defined function in another class?
Oops grabbed the path from the puppet output not the directory structure. The files should be: /etc/puppet/modules/sandbox/one/manifests/init.pp class one { include two testfn { test:} } /etc/puppet/modules/sandbox/two/manifests/init.pp class two::test { testfn {test: } } the following class works as it is in the same module as the define: /etc/puppet/modules/sandbox/two/manifests/test.pp class two::test { testfn {test: } } I tried ::one::testfn{test: } that also failed with the error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid tag "::one::testfn" at /etc/puppet/modules/sandbox/one/manifests/init.pp:3 on node bos-test01.contentstore.net -- 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.
Nigel Kersten
2011-Nov-08 17:41 UTC
Re: [Puppet Users] Using a defined function in another class?
On Tue, Nov 8, 2011 at 6:31 AM, Marc Richman < Marc.Richman@livewiremobile.com> wrote:> I have a function defined in one class that I would like to use in another > class, but I can not seem to get it to work, I set up a simple test case > and I get the following error: > Could not retrieve catalog from remote server: Error 400 on SERVER: > Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid > resource type testfn at /etc/puppet/modules/sandbox/one/manifests/init.pp:3 > on node bos-test01.contentstore.net > > > /etc/puppet/modules/sandbox/one/manifests/init.pp > class one { > include two > testfn { test:} > } > > /etc/puppet/modules/sandbox/two/manifests/init.pp > class two { > define testfn () { > notify {foo: } > } > } > > What am I doing wrong? >This isn''t a function. It''s a defined type. Functions are a different thing in Puppet. Put the define in a place the autoloader will find it. I''m assuming your modulepath is "/etc/puppet/modules/sandbox" ? /etc/puppet/modules/sandbox/two/manifests/testfn.pp define two::testfn() { ... } then you can declare instances of it from anywhere.> > Thanks > Marc > > -- > 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. > >-- Nigel Kersten Product Manager, Puppet Labs -- 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.