stackhpc / ansible-role-libvirt-host

This role configures a host as a Libvirt/KVM hypervisor. It can also configure storage pools and networks on the host.
36 stars 32 forks source link

Check for subnet changes and redeclare network if True #27

Open velis74 opened 4 years ago

velis74 commented 4 years ago

A proposal enhancement for #25

I had to create a filter to convert from get_xml's XML format into dict. facts and info did not return complete network info and were thus not useful.

Please forgive the when statements. I have no idea whether I could have done them nicer. The principal issue with them is of course fail-safe reading of possibly missing items from dict.

Edit: referenced the wrong issue, sorry.

velis74 commented 4 years ago

Eh, the beauty checks fail: could you please review & comment the code as-is before I check them?

velis74 commented 4 years ago

Apologies for another commit: I'm very new to ansible and didn't realise that it used my local plugin instead of the role's one (which wasn't updated)