In module A: define A::foo(....) In module B: require A file{"bar": require => A::foo[''baz''] } A::foo{"baz":} However puppet doesn''t seem to like the syntax around require=>A::foo[''baz'']. Is there a way to do this? Thanks in advance. -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/40bb7271-cda4-4480-9aee-2ebed2e8d828%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Trevor Vaughan
2013-Nov-07 03:01 UTC
Re: [Puppet Users] require a defined type from another module
Try A:Foo instead of A::foo. Trevor On Wed, Nov 6, 2013 at 3:45 PM, LTH <ltharris@vcu.edu> wrote:> In module A: > > define A::foo(....) > > In module B: > > require A > > file{"bar": > require => A::foo[''baz''] > } > > A::foo{"baz":} > > However puppet doesn''t seem to like the syntax around > require=>A::foo[''baz'']. > > Is there a way to do this? > > Thanks in advance. > > -- > 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 puppet-users+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/40bb7271-cda4-4480-9aee-2ebed2e8d828%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. >-- Trevor Vaughan Vice President, Onyx Point, Inc (410) 541-6699 tvaughan@onyxpoint.com -- This account not approved for unencrypted proprietary information -- -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CANs%2BFoVGhToD-wApzL4oYs2LD6sB7v0K6%3DSoLeSJNRtP1z60aQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Johan De Wit
2013-Nov-07 09:08 UTC
Re: [Puppet Users] require a defined type from another module
Hi, be carefull when you include a module with the ''require'' keyword instead of ''include'' with require, the class becomes a dependency for everything that''s in that manifest. See http://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html#declaring-a-class-with-require for the explanation. Using require <module> generates quickly dependency loops. Hope this helps Jo On 11/06/2013 09:45 PM, LTH wrote:> In module A: > > define A::foo(....) > > In module B: > > require A > > file{"bar": > require => A::foo[''baz''] > } > > A::foo{"baz":} > > However puppet doesn''t seem to like the syntax around > require=>A::foo[''baz'']. > > Is there a way to do this? > > Thanks in advance. > -- > 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 puppet-users+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/40bb7271-cda4-4480-9aee-2ebed2e8d828%40googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out.-- Johan De Wit Open Source Consultant Red Hat Certified Engineer (805008667232363) Puppet Certified Professional 2013 (PCP0000006) _________________________________________________________ Open-Future Phone +32 (0)2/255 70 70 Zavelstraat 72 Fax +32 (0)2/255 70 71 3071 KORTENBERG Mobile +32 (0)474/42 40 73 BELGIUM http://www.open-future.be _________________________________________________________ Next Events: Puppet Advanced Training | https://www.open-future.be/puppet-advanced-training-12-till-14th-november Zabbix Certified Training | http://www.open-future.be/zabbix-certified-training-18-till-20th-november Zabbix Large Environments Training | http://www.open-future.be/zabbix-large-environments-training-21-till-22nd-november Puppet Fundamentals Training | http://www.open-future.be/puppet-fundamentals-training-10-till-12th-december Subscribe to our newsletter | http://eepurl.com/BUG8H -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/527B5887.3070901%40open-future.be. For more options, visit https://groups.google.com/groups/opt_out.
Thanks but I still get a syntax error when doing file{"bar": require => A:foo[''baz''] } On Wednesday, November 6, 2013 10:01:10 PM UTC-5, Trevor Vaughan wrote:> > Try A:Foo instead of A::foo. > > Trevor > > > On Wed, Nov 6, 2013 at 3:45 PM, LTH <ltha...@vcu.edu <javascript:>> wrote: > >> In module A: >> >> define A::foo(....) >> >> In module B: >> >> require A >> >> file{"bar": >> require => A::foo[''baz''] >> } >> >> A::foo{"baz":} >> >> However puppet doesn''t seem to like the syntax around >> require=>A::foo[''baz'']. >> >> Is there a way to do this? >> >> Thanks in advance. >> >> -- >> 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 puppet-users...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/puppet-users/40bb7271-cda4-4480-9aee-2ebed2e8d828%40googlegroups.com >> . >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > Trevor Vaughan > Vice President, Onyx Point, Inc > (410) 541-6699 > tvau...@onyxpoint.com <javascript:> > > -- This account not approved for unencrypted proprietary information -- >-- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/4a22a15c-5dba-4060-bc04-05b40240e6ef%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Nov-08 14:17 UTC
Re: [Puppet Users] require a defined type from another module
On Thursday, November 7, 2013 9:37:02 AM UTC-6, lth wrote:> > Thanks but I still get a syntax error when doing > > file{"bar": > require => A:foo[''baz''] > } > >>Evidently you have not understood the advice for which you are giving thanks, because it was to NOT DO THAT. Instead, do this: file { ''bar'': # initial uppercase name components: require => A::Foo[''baz''] } Note there that 1. EACH name component in a resource reference must be capitalized (i.e. both the ''A'' and the ''Foo''), and 2. the name component separator is a double colon (::), not a single colon. In addition, the actual names of modules, classes, and resource types should begin with *lowercase* letters, so that resource references (which use capital letters) are distinguished from other uses of class and resource names. Thus, you should not have any module named "A"; rather, it should be named "a". Your definitions should thus have the form # initial lowercase letters: define a::foo(...) { #... } The autoloader will expect to find that definition in <module path>/a/manifests/foo.pp, where in principle case matters, but in practice that depends on the filesystem. John -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ec36270d-cbc0-4653-ad71-7437795b9e7b%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.