Go to file
2022-07-28 18:00:58 +03:00
defaults pin_hosts by default 2021-11-16 17:35:52 +03:00
meta fix meta 2021-11-16 16:20:21 +03:00
tasks use ansible_play_hosts_all 2021-12-22 19:16:52 +03:00
.gitignore add gitignore 2022-07-28 18:00:58 +03:00
README.md add hosts role 2021-11-02 17:14:48 +03:00

Add records in format ${ansible_host} ${FQDN} ${short} from inventory to /etc/hosts

Config example:

pin_hosts: yes

Inventory example:

node1.site.local ansible_host=10.2.1.5
node2.site.local ansible_host=10.2.1.6
node3.site.local ansible_host=10.2.1.7

Result /etc/hosts:

10.2.1.5 node1.site.local node1
10.2.1.6 node2.site.local node2
10.2.1.7 node3.site.local node3