another fix

This commit is contained in:
Sergey Bubnov 2018-11-21 10:33:33 +04:00
parent 182b4ec5ec
commit dc2eade3a9

View File

@ -56,7 +56,8 @@
mode: 0644
- name: register nodes in /etc/hosts
lineinfile:
dest: /etc/hosts regexp=".*{{ item }}$"
path: /etc/hosts
regexp: ".*{{ item }}$"
line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}"
state: present
when: hostvars[item].ansible_default_ipv4.address is defined