- name: Set interface
set_fact:
- interface: "{{ hostvars[inventory_hostname].interface|default('eth0') }}"
+ interface: "{{ ansible_default_ipv4.interface }}"
- name: Check for presence of /etc/network/interfaces
stat:
- name: ifdown and ifup
shell: "ifdown {{ interface }} && ifup {{ interface }}"
# Even if bounce_interface is False, we need to work around a Xenial issue
- # where removing resolvconf breaks DNS by removing /etc/resolv.conf. Bouncing
+ # where purging resolvconf breaks DNS by removing /etc/resolv.conf. Bouncing
# the interface rebuilds it.
+ # The Ubuntu bug is:
+ # https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1593489
when: bounce_interface == "True" or
(ansible_lsb.id|lower == 'ubuntu' and ansible_lsb.major_release|int >= 16)