ansible-netplan
ansible-netplan copied to clipboard
Backup not done and some lint issues
Describe the bug I notice that in my deployments backup are not done.
I identify 2 problems with that:
- I only set
netplan_backup_existing
but is not considered to launchtasks/existing.yml
- Lint where not good so backup was not done
Expected behavior
When only setting netplan_backup_existing
(and not netplan_remove_existing
), backup should be done.
I could make a PR with:
tasks/netplan.yml
- import_tasks: existing.yml
when:
- netplan_remove_existing or netplan_backup_existing
instead of
- import_tasks: existing.yml
when:
- netplan_remove_existing
And about lint, in tasks/existing.yml, add spaces before/after brackets for src: "{{ item['path'] }}"
and dest: "{{ item['path'] }}.bk"
.
While reading this task, I also notice that removing tack does not have conditional about netplan_remove_existing
, so maybe useful to add it:
- name: Removing Existing Configurations
file:
path: "{{ item['path'] }}"
state: absent
become: true
with_items: "{{ _netplan_configs['files'] }}"
when:
- netplan_remove_existing
- item['path'] != netplan_config_file
- netplan_configuration != []
@michel-thomas PR’s are welcome and very much appreciated
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I forget this issue. I try to contribute soon!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.