2023-04-11 21:32:34 +00:00
|
|
|
---
|
|
|
|
# task/remove_existing file for manage_netplan
|
|
|
|
- name: "Capturing existing configurations"
|
|
|
|
ansible.builtin.find:
|
|
|
|
paths: /etc/netplan
|
|
|
|
patterns: "*.yml,*.yaml"
|
|
|
|
register: _netplan_configs
|
2023-11-29 21:49:57 +00:00
|
|
|
become: true
|
2023-04-11 21:32:34 +00:00
|
|
|
|
|
|
|
- name: "Removing existing configurations"
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item['path'] }}"
|
|
|
|
state: absent
|
|
|
|
loop: "{{ _netplan_configs['files'] }}"
|
|
|
|
when: item['path'] != manage_netplan_config_file
|
|
|
|
and manage_netplan_configuration != []
|
2023-11-29 21:49:57 +00:00
|
|
|
become: true
|