Hi, In our current puppet environment I am trying to avoid having to define a separate node for each server. Is it possible to include classes based on parts of the hostname? All of our server hostnames have their function (Tomcat/DNS/Apache etc...) in the hostname. Eg: If the hostname is uk-tomcat-120.example.com, could I match on ''tomcat'' to include a tomcat related class from within the default node definition? I''m thinking something along the lines of a simple regex or exec using grep. Thanks. Pejay --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
What you are looking for is probably external nodes classification; http://reductivelabs.com/trac/puppet/wiki/ExternalNodes BR. Rune Stensø On 26 Nov, 10:48, Pejay <paul.mad...@gmail.com> wrote:> Hi, > > In our current puppet environment I am trying to avoid having to > define a separate node for each server. > > Is it possible to include classes based on parts of the hostname? All > of our server hostnames have their function (Tomcat/DNS/Apache etc...) > in the hostname. > > Eg: If the hostname is uk-tomcat-120.example.com, could I match on > ''tomcat'' to include a tomcat related class from within the default > node definition? > > I''m thinking something along the lines of a simple regex or exec using > grep. > > Thanks. > > Pejay--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Pejay wrote:> Eg: If the hostname is uk-tomcat-120.example.com, could I match on > ''tomcat'' to include a tomcat related class from within the default > node definition?A simpler route than external node classification (already mentioned), but not as flexible if your node groups are always changing: node "uk-tomcat-001.example.com", "uk-tomcat-002.example.com", ... "uk-tomcat-120.example.com" { include base include uk include tomcat } Another route if you adapt the facter recipe at http://reductivelabs.com/trac/puppet/wiki/Recipes/HostgroupFact : node default { include base include $hostgroup } -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---