forked from saratov/infra
Remove hosts hardcode
This commit is contained in:
parent
1b4696fabd
commit
9cd23a3b68
@ -59,12 +59,12 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
- name: register nodes in /etc/hosts
|
||||
lineinfile:
|
||||
path: /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 }}"
|
||||
#- name: register nodes in /etc/hosts
|
||||
# lineinfile:
|
||||
# path: /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 ]
|
||||
|
Loading…
Reference in New Issue
Block a user