I am actually running a Puppet 2.7x setup to benchmark its capabilities using a group of test servers.
My actual site.pp
:
node 'devnode' inherits 'deploy' {
include 'server1.test.com'
include 'server2.test.com'
include 'server3.test.com'
include 'server4.test.com'
}
node 'deploy' {
include motd
include ssh
include ntp
}
doesn't work as intended (meaning: the motd
, ssh
and ntp
modules are not applied to the nodes serverN.test.com
located within the devnode
node).
I previously had the following site.pp
:
node /^server[1-4]\.test\.com$/ {
include motd
include ssh
include ntp
}
but it lacks flexibility when I want to test a specific module on a single node.
Considering the following :
serverN.test.com
) doesn't unfortunately reflect the name of my
company servers (whom all have 'unique' names with very little to no
possibility for a regex to work, except maybe on the domaine
test.com
)devnode
) to facilitate
the inclusion/exclusion of nodes for the administratorswhat are my options ?
Thanks in advance.
If you cannot formulate a regex, that is unfortunate. If the test.com
domain is sufficient for your needs, you should use
node /.*\.test\.com$/ { ... }
instead of devnode
(which makes little sense anyway, because it is only matched by agents whose unqualified names is "devnode").
If your fqdn
s are that chaotic, you may benefit from an ENC such as Foreman or the web interface of Puppet Enterprise after all. Such a classifier allows you to link classes to nodes flexibly. The hiera_include
function will make Hiera a simplistic ENC even.
An option that forgos the ENC idea is of course to enumerate your fqdn
s in nodes.pp
, perhaps introducing another inheritance layer.
node fqdn1.test.com inherits devnode { ... }
node fqdn2.test.com inherits devnode { ... }
...