tripleo-quickstart-extras/roles/baremetal-prep-virthost/tasks/remove_ens3.yml
Ronelle Landy 9ba91813fc Move ens3 role to a baremetal-only playbook/role
Removing the ens3 network-scripts file is needed when
creating a Centos 8 VM for the undercloud in baremetal
deployments.

Change-Id: I28760c662b7aaf27582c46281855d79f874f369e
2020-07-02 10:42:46 -04:00

22 lines
479 B
YAML

---
- name: Discover if ens3 interface exists
become: true
setup:
gather_subset: network
register: net
- name: Check if ifcfg-ens3 exists
become: true
stat:
path: /etc/sysconfig/network-scripts/ifcfg-ens3
register: ens3_interface
- name: Remove the interface file
become: true
file:
path: /etc/sysconfig/network-scripts/ifcfg-ens3
state: absent
when:
- ens3_interface.stat.exists
- "'ens3' not in net.ansible_facts.ansible_interfaces"