Linux – puppet – define wildcard host in nodes.pp

linuxpuppet

Is there a way to define wildcard hosts in puppetmasterĀ“s nodes.pp

say i want all the hosts in one domain to receive a set of classes can i do something like:

# nodes.pp
#

node basenode {
  include  admina, adminb, admic
  }


node "*.acme.com" {
    include adminc
    }

Best Answer

Not in this way. You can create a 'default' node that will apply to any signed client.

node "default" {
   include foo
}

But you can only have 1 default. If you want to replicate the functionality you describe you can use the external_nodes method of classification. Basically you write a script that returns valid yaml when a client connects. That script can do it anyway you want, check fqdn, query a db, hit ldap, etc.