Karen Loomans
unread,Nov 16, 2011, 1:19:43 AM11/16/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hi,
I have a module to manage /etc/hosts that works fine
for RHEL, but not on Solaris. Basically I've defined all our hosts as
virtual host resources, and grouped them various ways by tagging them.
These are then realized based on the tags for each node as appropriate.
Hosts can have multiple tags and not have any issues with duplicate
resource declarations as they are virtual. Any unmanaged host is then
purged from the hosts file.
The problem for Solaris occurs with the localhost entries:
::1 localhost
127.0.0.1 localhost
You can't define host resources with the same name.
I would prefer to keep using the host resource if I can as it all
works beautifully on our RHEL servers (the localhost names are unique).
I thought I might be able to:
1. Template the
beginning of the hosts file to include the localhost entries appropriate to the os, writing out to /tmp/hosts_head.
2. Generate another file in /tmp/hosts_body that contains the remainder of the hosts
using my current method of realizing the virtual hosts.
3. Concatenate the two.
However, when I redirect the target for all the host resources to /tmp/hosts_body, it rips out the contents in the real /etc/inet/hosts:
notice: /Stage[after]/Hosts::Virtual/Host[george]/target: target changed '/etc/inet/hosts' to '/tmp/hosts_body'
Has anyone solved this problem on Solaris or can offer some suggestions?
Thanks in advance,
Karen