forked from saratov/infra
register all nodes in /etc/hosts
This commit is contained in:
parent
63f42eb419
commit
29c65bcc08
@ -54,4 +54,11 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
- name: register nodes in /etc/hosts
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/hosts regexp=".*{{ item }}$"
|
||||||
|
line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}"
|
||||||
|
state: present
|
||||||
|
when: hostvars[item].ansible_default_ipv4.address is defined
|
||||||
|
with_items: play_hosts
|
||||||
tags: [ prepare ]
|
tags: [ prepare ]
|
||||||
|
Loading…
Reference in New Issue
Block a user