manage_netplan/tasks/remove_existing.yml
Bertrand Lanson 3967974270
Some checks failed
test / Linting (push) Failing after 10s
test / Molecule tests (default, debian11) (push) Has been skipped
test / Molecule tests (default, debian12) (push) Has been skipped
test / Molecule tests (default, ubuntu2004) (push) Has been skipped
test / Molecule tests (default, ubuntu2204) (push) Has been skipped
test / Molecule tests (with_custom_config, debian11) (push) Has been skipped
test / Molecule tests (with_custom_config, debian12) (push) Has been skipped
test / Molecule tests (with_custom_config, ubuntu2004) (push) Has been skipped
test / Molecule tests (with_custom_config, ubuntu2204) (push) Has been skipped
feat: add vagrant tests for later, add become: true to some tasks to not rely on ansible.cfg
2023-11-29 22:49:57 +01:00

18 lines
484 B
YAML

---
# task/remove_existing file for manage_netplan
- name: "Capturing existing configurations"
ansible.builtin.find:
paths: /etc/netplan
patterns: "*.yml,*.yaml"
register: _netplan_configs
become: true
- 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 != []
become: true