Hi all,
I'm just a beginner with puppet (and perhaps foolishly, am implementing it
a week before I leave this job - it's only been on my TODO list for 2
years now). My puppetmaster is debian version 2.6.2-4.
I've got a definition that has got me stumped as to its behaviour.
#ensure hostname properly qualified in /etc/hosts (fqdn first, then
#shortname second, then subsequent aliases).
define hostentry($ip, $hostaliases = [], $ensure = present) {
host { $name:
ensure => absent,
}
host { "$name.aao.gov.au":
ensure => $ensure,
ip => $ip,
host_aliases => [$name, $hostaliases],
}
}
hostentry { "puppet":
ip => "192.231.166.36",
hostaliases => ["aatlxha.aao.gov.au", "aatlxha"],
}
If I expand that out so it reads
host { "puppet":
ensure => absent,
}
host { "puppet.aao.gov.au":
ensure => present,
ip => "192.231.166.36",
host_aliases => ["puppet", "aatlxha.aao.gov.au", "aatlxha"],
}
then the hosts file only gets updated the once. But if I use the
hostentry definition, then it gets every run.
A clue perhaps is those hosts without a hostaliases:
notice:
/Stage[main]/Hosts/Hosts::Hostentry[aatlxc]/Host[aatlxc.aao.gov.au]/host_aliases:
host_aliases changed 'aatlxc' to 'aatlxc '
I'm creating a list from an item and a list, and a list with an empty item
will just make for an excess space (which the hosts definition appears to
later remove, or at least, there's not an excess space in my file
/etc/hosts file). The problem could be stemming from the fact that there
are lists of lists there that get interpolated out, but I couldn't work
out a way to just concatenate the two lists together given the way
variable scoping works.
How would you tackle this?
Is the output file atomically renamed into place? If it does needless
updates every half an hour, but atomically renames it into place, we can
live with that because it's not a large network. But if it just writes it
into place, then occasionally we're going to try to read from a
half-written file.
--
Tim Connors
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.