ansible/ansible — pull request #5065 by resmo (2013-11-26 20:03:42+00:00)
Title: host: added new module

This is a rewrite of the old host module.

What is different:

* Module will not change IPs in other version, e.g. IPv4 to IPv6.
* Change or removal of loopback IPs (127/8, ::1) must be forced using IP match IP=127.0.0.1 or using ignore_loopback=no (default=yes). See examples.
* Does not stop on first match, which means e.g. you can handle IPv6 and IPv4 hostname to be absent in one task.
* Implemented a shift feature for aliases (keep_aliases=yes). So first alias becomes the new hostname on state=absent and if aliases are availabe.

Tests:

Test module has been extended.

TODOs:

* loopback IP detection should be improved.
* IP validation?