Closed ctreatma closed 2 months ago
I'm guessing the 404 is happening because the metal_device
[module attempts to fetch the hardware reservation by ID before it makes the request to create a device](https://github.com/equinix/ansible-collection-equinix/blob/520e67d02c6d149bc5cfc8589b8df86d5d8246a6/plugins/modules/metal_device.py#L768-L773:
if module.params.get("hardware_reservation_id"):
hw_res = module.get_hardware_reservation()
if hw_res["provisionable"] is False:
module.fail_json(
msg="Hardware reservation %s is not provisionable" % hw_res['id']
)
The analogous metal_device
resource in Terraform does not attempt to fetch the reservation. If the reservation is not provisionable, the request to create a device will fail anyway, so the metal_device
Ansible module should allow that to happen rather than trying to validate the specified reservation directly.
This issue has been resolved in version 0.10.1 :tada:
SUMMARY
According to the collection docs, users can specify
next-available
as thehardware-reservation-id
to select an available reservation without having to specify a particular reservation's UUID.In practice, this results in a 404 error.
ISSUE TYPE
COMPONENT NAME
metal_device
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
Based on the Ansible collection docs and the underlying Metal API feature, I expect the playbook above to provision a Metal device on an unused hardware reservation in my project.
ACTUAL RESULTS
The playbook fails with the below error output