On Feb 4, 11:01 am, chris mague <[email protected]> wrote:
> John,
>
> Thanks for the hint.
> It was unclear what I wanted to do.
>
> Instead of excluding one host from the exported resources, I would
> like to autopopulate /etc/hosts, overriding the value stored in the
> database [...]
> I think this would be possible in 2.6.4 by doing
>
> Host <<| tag == "stagehosts" and title != $fqdn |>>
Ah. That does make more sense.
Are you using tags to distinguish between different groups of exported
hosts? If not, then I think you should be able to do this:
====
Host { target => '/etc/hosts' }
@@host { $fqdn:
ip => $ipaddress,
host_aliases => [$hostname],
}
Host <<| name != $fqdn |>>
host { "localhost.localdomain":
ip => '127.0.0.1',
host_aliases => [ 'localhost', 'foo.bar.com', 'foo' ]
}
resources { "host": purge => true }
====
If that doesn't meet your need then you may need to consider upgrading
Puppet. However, I don't see any closed tickets that lead me to
expect a change between 2.6.2 and 2.6.4 with respect to filter
conditions, nor any open ones leading me to believe that 2.6.2 doesn't
already handle logical combinations of filter criteria as documented.
Do you get an error when you try? If it's broken, you should file a
ticket so that it gets fixed.
Any way around, you should probably filter on 'name' as I do above,
not on 'title'. The name should be what actually gets written into
the hosts file; title can conceivably be something different.
The bottom line is this: to collect some but not all exported
resources of a given type, you have to provide filter conditions that
distinguish between the resources you want and those you don't.
Best,
John
--
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.