forked from saratov/infra
Remove hosts hardcode
This commit is contained in:
parent
1b4696fabd
commit
9cd23a3b68
@ -59,12 +59,12 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
- name: register nodes in /etc/hosts
|
#- name: register nodes in /etc/hosts
|
||||||
lineinfile:
|
# lineinfile:
|
||||||
path: /etc/hosts
|
# path: /etc/hosts
|
||||||
regexp: ".*{{ item }}$"
|
# regexp: ".*{{ item }}$"
|
||||||
line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}"
|
# line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}"
|
||||||
state: present
|
# state: present
|
||||||
when: hostvars[item].ansible_default_ipv4.address is defined
|
# when: hostvars[item].ansible_default_ipv4.address is defined
|
||||||
with_items: "{{ play_hosts }}"
|
# with_items: "{{ play_hosts }}"
|
||||||
tags: [ prepare ]
|
tags: [ prepare ]
|
||||||
|
Loading…
Reference in New Issue
Block a user