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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.