cloudscale-ch / ansible-collection-cloudscale

cloudscale.ch Ansible Collection
https://galaxy.ansible.com/cloudscale_ch/cloud
GNU General Public License v3.0
7 stars 3 forks source link

Feature/networkinterface #51

Closed ctx closed 3 years ago

href commented 3 years ago

The has_wanted_interfaces looks good for all regular cases. But I'm think there might be some pathological cases where it fails. Like if someone has multiple interfaces on the same network or if someone tries to get a specific address on a public network. But I'm not sure how much we should care about these cases.

From what I can tell it is not possible to attach the same network multiple times. If you try doing that in the API, you get the following error: "It's not allowed to attach to the same network more than once".

That's why there's no provision for this case. Should that change we'd have to adapt our code. Alas, the logic is definitely not beyond errors and when they pop up we'll have to look at them. All the cases I could think of should be handled however.

gaudenz commented 3 years ago

LGTM now. As a last step I would now clean up the history to only have 2 or maybe 3 commits:

  1. unrelated doc change
  2. new interfaces parameter
  3. tests either in a separate commit or included in 2

Do you want to do that or should I do that myself?