Issue #10704 has been updated by Daniel Pittman.

Assignee set to Nigel Kersten

Bil Tong wrote:
> Can't the key for the hostfile be based on both the ip and the hostname 
> together?

Actually, the model of `/etc/hosts` is inconsistent, where some platforms 
filter duplicate entries and others don't, based any of the fields.

The least worst model is that the IP address, of which there is one record per 
line, is the unique key, and the official name and aliases hang from that; this 
exposes the platform inconsistency around handling duplicate hostname entries 
to the user, but isn't too terrible.

The parser should be tolerant of duplicate IP rows, however, and merge those 
into a uniqified set of host names and aliases.

That would give the least worst behaviour given the way that different 
platforms handle this content.

In other words: the bug as reported is correct, and our model is not consistent 
with the real world needs for management of entries in `/etc/hosts`.
----------------------------------------
Bug #10704: puppet's idea of /etc/hosts management does not match real world use
https://projects.puppetlabs.com/issues/10704

Author: Bil Tong
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category: host
Target version: 
Affected Puppet version: 2.7.6
Keywords: 
Branch: 


Here is a valid extract from an /etc/hosts files on a RHEL box:

    127.0.0.1   localhost localhost.localdomain localhost4 
localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 
localhost6.localdomain6

Here is the code to make puppet add these entries:

        host { 'localhost':
                ip => '127.0.0.1',
                host_aliases => [ 'localhost.localdomain',
                        'localhost4', 'localhost4.localdomain4', ],
        }

       host { 'localhost':
               ip => '::1',
               host_aliases => [ 'localhost.localdomain',
                       'localhost6', 'localhost6.localdomain6', ],
       }

Notice the "localhost" part is the same in both cases. This causes a problem:

    Could not retrieve catalog from remote server: Error 400 on SERVER: 
Duplicate definition: Host[localhost] is already defined in file 
/etc/puppet/modules/networking/manifests/init.pp

puppet-2.7.6-2.el6.noarch


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to