Issue with host resource type

32 views
Skip to first unread message

William Thomas

unread,
Dec 12, 2023, 5:09:41 PM12/12/23
to Puppet Users
In most Linux distributions, if there are multiple entries for a host in /etc/hosts the first entry has precedence.   With the Puppet host resource, if there are multiple entries for that name, Puppet will modify the last entry.   

So if a system has a /etc/hosts file with the following entries:

127.0.0.5    testhost
127.0.0.6    testhost

testhost will resolve to 127.0.0.5

When a Puppet host resource is applied to that server like
host { 'testhost':
ip => '127.0.0.7',
}

The /etc/hosts file will become
127.0.0.5  testhost
127.0.0.7  testhost

And testhost will still resolve to 127.0.0.5.

I have seen this behavior in Puppet 6 and Puppet 7.

Reply all
Reply to author
Forward
0 new messages