Kenneth Lo
2012-Aug-16 15:32 UTC
[Puppet Users] Can I re-use a Exec resource from multiple un-related classes?
The idea is that let say I have a Class define as "helperFunctions" where I put in a bunch of shell script exec resources, along with some file resources as requirement. Can I then have other classes'' resource to Subscribe and/or Notify to specific Exec resource within that helperFunction class? The only interClass dependency I''ve done based on puppet''s example are all per class, not per resource… So is this possible and what''s the proper syntax for it? Thanks in advance. --KL This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- 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.
Kenneth Lo
2012-Aug-16 19:48 UTC
Re: [Puppet Users] Can I re-use a Exec resource from multiple un-related classes?
Looks like with some testing I answered my own question. :) As soon as the ''helpFunction'' class is included in a node, I can simply notify the resource there from other classes as well. If I re-define the Exec resource in other classes I would ended up getting multi-define error. --KL From: KENNETH LO <klo@paydiant.com<mailto:klo@paydiant.com>> Reply-To: "puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>" <puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>> Date: Thu, 16 Aug 2012 15:32:01 +0000 To: "puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>" <puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>> Subject: [Puppet Users] Can I re-use a Exec resource from multiple un-related classes? The idea is that let say I have a Class define as "helperFunctions" where I put in a bunch of shell script exec resources, along with some file resources as requirement. Can I then have other classes'' resource to Subscribe and/or Notify to specific Exec resource within that helperFunction class? The only interClass dependency I''ve done based on puppet''s example are all per class, not per resource… So is this possible and what''s the proper syntax for it? Thanks in advance. --KL This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- 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<mailto:puppet-users@googlegroups.com>. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com<mailto:puppet-users+unsubscribe@googlegroups.com>. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- 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.
jcbollinger
2012-Aug-17 13:31 UTC
Re: [Puppet Users] Can I re-use a Exec resource from multiple un-related classes?
On Thursday, August 16, 2012 2:48:54 PM UTC-5, Kenneth Lo wrote:> > Looks like with some testing I answered my own question. :) > > As soon as the ''helpFunction'' class is included in a node, I can simply > notify the resource there from other classes as well. If I re-define the > Exec resource in other classes I would ended up getting multi-define error. > >Yes, all classes *and resources* in Puppet have global scope and visibility once declared. Furthermore, resources are not namespaced. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/JN5q8Z_WZ28J. 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.