Skip to content

Commit

Permalink
Updated task to use first found mac address when multiple networks ar…
Browse files Browse the repository at this point in the history
…e involved

This commit needs to be revisited when there are multiple external networks are
attached to the virtual machines.
  • Loading branch information
samvarankashyap committed Feb 18, 2019
1 parent 775bf82 commit b58c2b7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,10 @@
loop_var: node
register: extract_mac_address_result

# needs to be updated when multiple external addresses are involved
- name: "mac_and_ip | wait up to 5 mins for dhcp ip address"
shell: |
/usr/sbin/arp -an | grep -F {{ extract_mac_address_result.results[mac].stdout }} | cut -f 2 -d "(" | cut -f 1 -d ")"
/usr/sbin/arp -an | grep -F {{ extract_mac_address_result.results[mac].stdout_lines[0] }} | cut -f 2 -d "(" | cut -f 1 -d ")"
with_items:
- "{{ res_count.stdout }}"
loop_control:
Expand All @@ -356,9 +357,10 @@
delay: 10
when: uri_hostname == 'localhost'

# Note: The task needs to be updated when multiple external addresses are involved
- name: "mac_and_ip | wait up to 5 mins for dhcp ip address"
shell: |
/usr/sbin/arp -an | grep -F {{ extract_mac_address_result.results[mac].stdout }} | cut -f 2 -d "(" | cut -f 1 -d ")"
/usr/sbin/arp -an | grep -F {{ extract_mac_address_result.results[mac].stdout_lines[0] }} | cut -f 2 -d "(" | cut -f 1 -d ")"
with_items:
- "{{ res_count.stdout }}"
loop_control:
Expand Down

0 comments on commit b58c2b7

Please sign in to comment.