Hi all so far I''m loving Puppet, have asked a few questions on IRC and had really good support there. This one has me scratching my head, though. I was hoping to use puppets implicit tagging feature to handle iptables configs e.g. # iptables.erb <% if tags.includes(''webserver'') %> # allow port 80 in <% end %> So I wrote a quick module to test that tags worked how I expected them to, and they don''t seem to. My entire puppet config is up on github ( http://github.com/rasputnik/babysteps-puppet/tree/master ) if that helps. # http://github.com/rasputnik/babysteps-puppet/blob/master/manifests/roles.pp class baseclass { include root_mail include ssh include tagtest } # http://github.com/rasputnik/babysteps-puppet/blob/master/manifests/nodes.pp node ''node03'' { include baseclass } The ''tagtest'' module ( http://github.com/rasputnik/babysteps-puppet/tree/master/modules/tagtest ) runs a simple template to dumps all defined tags defined to /tagtest. On node03 it looks ilke this: baseclass class main node node03 tagtest i.e. ''root_mail'' and ''ssh'' are absent. Can someone explain why? I''m hoping there''s a simple ''replace include with inherits'' type trick to sort this out. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Any comments on this one? Even a ''don''t do that, do this'' would be great :) On Sat, May 30, 2009 at 11:20 PM, Dick Davies <rasputnik@hellooperator.net> wrote:> Hi all > > so far I''m loving Puppet, have asked a few questions on IRC and had > really good support there. > This one has me scratching my head, though. > > I was hoping to use puppets implicit tagging feature to handle > iptables configs e.g. > > # iptables.erb > > <% if tags.includes(''webserver'') %> > # allow port 80 in > <% end %> > > So I wrote a quick module to test that tags worked how I expected them > to, and they don''t seem to. > My entire puppet config is up on github ( > http://github.com/rasputnik/babysteps-puppet/tree/master ) if that > helps. > > # http://github.com/rasputnik/babysteps-puppet/blob/master/manifests/roles.pp > class baseclass { > > include root_mail > include ssh > > include tagtest > } > > # http://github.com/rasputnik/babysteps-puppet/blob/master/manifests/nodes.pp > node ''node03'' { include baseclass } > > The ''tagtest'' module > ( http://github.com/rasputnik/babysteps-puppet/tree/master/modules/tagtest ) > runs a simple template to dumps all defined tags defined to /tagtest. > On node03 it looks ilke this: > > baseclass > class > main > node > node03 > tagtest > > i.e. ''root_mail'' and ''ssh'' are absent. > > Can someone explain why? I''m hoping there''s a simple ''replace include > with inherits'' type > trick to sort this out. >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, On Sat, 2009-05-30 at 23:20 +0100, Dick Davies wrote:> Hi all > > so far I''m loving Puppet, have asked a few questions on IRC and had > really good support there. > This one has me scratching my head, though. > > I was hoping to use puppets implicit tagging feature to handle > iptables configs e.g. > > # iptables.erb > > <% if tags.includes(''webserver'') %> > # allow port 80 in > <% end %> > > So I wrote a quick module to test that tags worked how I expected them > to, and they don''t seem to. > My entire puppet config is up on github ( > http://github.com/rasputnik/babysteps-puppet/tree/master ) if that > helps. > > # http://github.com/rasputnik/babysteps-puppet/blob/master/manifests/roles.pp > class baseclass { > > include root_mail > include ssh > > include tagtest > } > > # http://github.com/rasputnik/babysteps-puppet/blob/master/manifests/nodes.pp > node ''node03'' { include baseclass } > > The ''tagtest'' module > ( http://github.com/rasputnik/babysteps-puppet/tree/master/modules/tagtest ) > runs a simple template to dumps all defined tags defined to /tagtest. > On node03 it looks ilke this: > > baseclass > class > main > node > node03 > tagtest > > i.e. ''root_mail'' and ''ssh'' are absent. > > Can someone explain why? I''m hoping there''s a simple ''replace include > with inherits'' type > trick to sort this out.My understanding is that ''user'' tags becomes real tags only on the client, that is way after the templates are processed. This is subject to change in 0.25 per the discussion we had with Luke about #2246 over the week-end. So I''m afraid that it is not possible for the moment. -- Brice Figureau My Blog: http://www.masterzen.fr/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Bruce thanks for the reply. I''m showing my ignorance now, but how do ''user'' tags differ from ''implicit'' tags? My template *does* have a tags array populated, just only with class/node/etc. information from the ''current'' class. I just wondered if that was intentional, or if somewhere in the puppet code, there''s a tags = get_tags() that could be replaced with (tags+get_tags()).uniq , if you see what I mean. I''ll have a poke around github.com/lak next, I guess. Thanks again. On Tue, Jun 2, 2009 at 1:40 PM, Brice Figureau <brice-puppet@daysofwonder.com> wrote:> > Hi, > > On Sat, 2009-05-30 at 23:20 +0100, Dick Davies wrote: >> Hi all >> >> so far I''m loving Puppet, have asked a few questions on IRC and had >> really good support there. >> This one has me scratching my head, though. >> >> I was hoping to use puppets implicit tagging feature to handle >> iptables configs e.g. >> >> # iptables.erb >> >> <% if tags.includes(''webserver'') %> >> # allow port 80 in >> <% end %> >> >> So I wrote a quick module to test that tags worked how I expected them >> to, and they don''t seem to. >> My entire puppet config is up on github ( >> http://github.com/rasputnik/babysteps-puppet/tree/master ) if that >> helps. >> >> # http://github.com/rasputnik/babysteps-puppet/blob/master/manifests/roles.pp >> class baseclass { >> >> include root_mail >> include ssh >> >> include tagtest >> } >> >> # http://github.com/rasputnik/babysteps-puppet/blob/master/manifests/nodes.pp >> node ''node03'' { include baseclass } >> >> The ''tagtest'' module >> ( http://github.com/rasputnik/babysteps-puppet/tree/master/modules/tagtest ) >> runs a simple template to dumps all defined tags defined to /tagtest. >> On node03 it looks ilke this: >> >> baseclass >> class >> main >> node >> node03 >> tagtest >> >> i.e. ''root_mail'' and ''ssh'' are absent. >> >> Can someone explain why? I''m hoping there''s a simple ''replace include >> with inherits'' type >> trick to sort this out. > > My understanding is that ''user'' tags becomes real tags only on the > client, that is way after the templates are processed. > > This is subject to change in 0.25 per the discussion we had with Luke > about #2246 over the week-end. > > So I''m afraid that it is not possible for the moment. > -- > Brice Figureau > My Blog: http://www.masterzen.fr/ > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---