mrlesmithjr / ansible-netplan

Ansible role to manage Netplan
MIT License
130 stars 84 forks source link

Change of IP causes play to hang #16

Closed benjoyce closed 4 years ago

benjoyce commented 4 years ago

Hi. I'm changing the IP and during the role execution the play hangs and ultimately fails, however the IP is changed as expected.

In the example log below I changed the VMs IP from 98 to 97:

changed: [10.0.0.98]

RUNNING HANDLER [ansible-netplan : Generating Netplan Configuration] ********************************************************************************************************
changed: [10.0.0.98]

RUNNING HANDLER [ansible-netplan : Applying Netplan Configuration] **********************************************************************************************************
fatal: [10.0.0.98]: FAILED! => {"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.0.0.98 port 22: No route to host"}

NO MORE HOSTS LEFT **********************************************************************************************************************************************************

PLAY RECAP ******************************************************************************************************************************************************************
10.0.0.98                  : ok=4    changed=2    unreachable=0    failed=1    skipped=3    rescued=0    ignored=0   

Any thoughts on how to handle this? (excuse the pun)

Cheers,

Ben

benjoyce commented 4 years ago

Resolved using aync/poll.

  command:    netplan apply
  async:      3600
  poll:       0
  listen:     netplan apply config
  when:       netplan_apply