Merge "Limit hostfile generation to control nodes"

This commit is contained in:
Jenkins 2016-08-31 14:51:02 +00:00 committed by Gerrit Code Review
commit 5f0ea5847f
2 changed files with 5 additions and 5 deletions

View File

@ -2,12 +2,12 @@
- name: get real node hostname
shell: echo $(hostname)
register: real_node_hostname
delegate_to: "{{ baremetal_node }}"
delegate_to: "{{ control_node }}"
- name: get real node ip
shell: ip -4 addr show "{{ hostvars[baremetal_node]['baremetal_nic'] }}" | grep -oP "(?<=inet )[\d\.]+(?=/)"
shell: ip -4 addr show "{{ hostvars[control_node]['baremetal_nic'] }}" | grep -oP "(?<=inet )[\d\.]+(?=/)"
register: real_node_ip
delegate_to: "{{ baremetal_node }}"
delegate_to: "{{ control_node }}"
- name: Insert hosts entries for all kolla-ansible hosts
lineinfile:

View File

@ -39,9 +39,9 @@
when: customize_etc_hosts | bool == True
- include: append_to_etc_hosts.yml
with_inventory_hostnames: baremetal
with_inventory_hostnames: control
loop_control:
loop_var: baremetal_node
loop_var: control_node
become: True
when: customize_etc_hosts | bool == True