On Tuesday, December 4, 2012 10:02:42 AM UTC-5, jcbollinger wrote: > > > On Monday, December 3, 2012 5:25:58 PM UTC-6, Dusty Doris wrote: >> >> [...] I'm trying to figure out how I can re-write this to make it work, >> but it appears the puppet dsl only acts on arrays when they are the name >> variable and then calls the resource once for each item in the array, >> passing that as the name. >> > > > Yes, that is precisely what Puppet does with arrays given as resource > titles, and that behavior is triggered *only* by titles. > > > >> >> So, I suppose right now I need to make my groups better, so they include >> all the one-offs and make sure there are no duplicates. Or, I could just >> define the one-offs one at a time in each node file. >> >> I appreciate any suggestions. >> >> > > One way to look at your issue is that your site-specific data is too > commingled with your code. That's why you have one-offs in the first > place. Pull the data together into a class variable somewhere, or even > externalize it into an Hiera data store. Drive your firewall declarations > with your data instead of pulling the data along behind. > > More specifically, you can use Puppet hashes or Hiera lookups to > dynamically adapt your declarations to specific cases (e.g. to choose > parameter values), or you can use the built-in create_resources() function > to declare whole resources based on your data. You already know about > arrays as resource titles and combining that with defined types; those fit > into the picture, too. > > > John >
Thanks John. That sounds like some fantastic advice. I'm brand new to puppet and still trying to wrap my mind around it. I'd love any resources if you have any recommendations (eg: any good books?) -- 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/-/jvAAEVjV2kQJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.