Closed dasavick closed 4 years ago
I investigated further and I'm not really sure why this module uses image
property to read server_type
. Correct property from the API seems to be server_type.name
. While image property returned by API is null for that problematic VM, this whole issue looks like it was caused by some mistake:
Current readouts of server_type
:
debian-10
debian-10
debian-10
debian-10
debian-10
debian-10
Image section would fail too:
self.inventory.set_variable(server.name, "image_id", to_native(server.image.id))
self.inventory.set_variable(server.name, "image_name", to_native(server.image.name))
self.inventory.set_variable(server.name, "image_os_flavor", to_native(server.image.os_flavor))
At the end I think image
property handling is our primary issue while server_type
is unrelated mistake. Current API schema shows that image
property is nullable so it is probably an issue with the module itself:
Please use the collection v0.1.0 (or better: v0.2.0). There it is fixed.
Thanks, it works. But I still wonder why there is no fallback to server_type.name
in case image is not present? Or rather why image name is used instead of server_type.
SUMMARY
Plugin fails to read inventory with vm created from image. Most likely due to the fact that source snapshot was deleted.
ISSUE TYPE
COMPONENT NAME
hcloud
ANSIBLE VERSION
CONFIGURATION
No changes.
OS / ENVIRONMENT
N/A
STEPS TO REPRODUCE
EXPECTED RESULTS
Ansible loads inventory.
ACTUAL RESULTS
The image propery is None for that specific server and causes load fail.