mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-01-11 18:09:59 -03:30
Use IP is specified, otherwise use the ansible discovered address.
This fixes cases for use in Vagrant environments.
This commit is contained in:
parent
babf42f03a
commit
fe5ec398bf
@ -2,8 +2,8 @@
|
||||
- name: populate inventory into hosts file
|
||||
lineinfile:
|
||||
dest: /etc/hosts
|
||||
regexp: "^{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}$"
|
||||
line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}"
|
||||
regexp: "^{{ hostvars[item]['ip'] | default(hostvars[item].ansible_default_ipv4.address) }} {{ item }}$"
|
||||
line: "{{ hostvars[item]['ip'] | default(hostvars[item].ansible_default_ipv4.address) }} {{ item }}"
|
||||
state: present
|
||||
backup: yes
|
||||
when: hostvars[item].ansible_default_ipv4.address is defined
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user