mrlesmithjr / ansible-netplan

Ansible role to manage Netplan
MIT License
132 stars 85 forks source link

Netplan role removes configurations by default #50

Closed egorperesada closed 2 months ago

egorperesada commented 6 months ago

Describe the bug If we are using default variables, this role remove all existing netplan configuration on server and add empty ansible-config.yaml configuration

To Reproduce Steps to reproduce the behavior:

  1. do not reassign any netplan variables
  2. run playbook with this role
  3. $ ls /etc/netplan # on your server
  4. will see /etc/netplan/ansible-config.yaml
  5. $ cat /etc/netplan/ansible-config.yaml
  6. will see it's empty

Expected behavior Existing netplan configuration exists in /etc/netplan

Screenshots telegram-cloud-photo-size-2-5280494078494103384-x telegram-cloud-photo-size-2-5280494078494103386-m

Desktop (please complete the following information):

Additional context This happens because your default netplan_configuration asssigned as {} (object), but in task conditions it's expected to be not an array []

richard-scott commented 5 months ago

I'd assumed that setting netplan_remove_existing to False would mean any new config would merge with the existing config. I was wrong! ;-(

stale[bot] commented 3 months ago

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.