Melvin Mah
2014-Aug-01 08:51 UTC
[Puppet Users] Extracting Hostname from Hieradata as Manifest Nodenames
I am experimenting something to see if Puppet does the generic and
self-provisioning that some laymen say they would like to see.
In the common.yaml, my hostname structure is something like:
:test: (environment name)
- mocha-test1 (hostname)
- glpi-49
:development:
- timemachine
I am not sure whether people have done it or not, but I have seen people
creating a generic manifest using a regex pattern matching for the host
names stored in the Puppet Master catalog. Usually, it would be like:
node /^mi-cloud-(dev|stg|prd)-host/ {
if $is_virtual == 'false' {
include etchosts
include checkmk-agent
include nmonitor
include rootsh
include sysstatpkg
include cronntpdate
include fstab-ds-dev
}
}
On the other hand, I was thinking of looping in the manifest in the likes
of something below:
$env1 = hiera('test')
$env2 = hiera('development')
node $env1[$name] {
notify("Now at Test environment $env1[0]");
<do whatever activity here>
}
node $env1[$name] {
notify("Now at Test environment $env2[0]");
<do whatever activity here>
}
According to a colleague of mine who went for the workshop 6 months ago,
the Puppet trainers have claimed that of no such concept of
self-provisioning exists in there. In most examples that I've looked around
on the Internet, it's mostly done on file, services and others, but not on
nodes. However, the information he shared was based around version 3.4 /
3.5.
1. Is it actually implementable?
2. Is there a high likely that the master system can be screwed up using
that approach?
3. Is it a higher risk in managing and maintaining other agents in this
approach rather than the individual one agent manifest thing?
If there's anyone who've seen and done that approach above, would be
great
if an example can be shared.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/59781e67-0f43-4903-8456-6bc4043cac26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.