Reboot is needed. Ifup down does not always get rid of the template ip

This commit is contained in:
2018-11-26 09:00:01 -05:00
parent c8f851d4be
commit b48f9f8dbb

View File

@@ -9,8 +9,8 @@
interface_name: "{{ ansible_default_ipv4.interface }}"
template: src=../roles/configure-interfaces/templates/eth.cfg.j2 dest=/etc/network/interfaces.d/{{ interface_name }}.cfg
- name: Up down interface
shell: "(sleep 3s; ifdown {{ interface_name }} && ifup {{ interface_name }};) &"
- name: Reboot instance to pickup new network config
shell: "bash -c 'sleep 15s; reboot;' &"
ignore_errors: true
vars:
interface_name: "{{ ansible_default_ipv4.interface }}"