when nsxt_fabric_nodes performs idempotency check, it needs to check the current node status and wait till a terminal state is reached before returning.
The full traceback is:
File "/tmp/ansible_uLVO49/ansible_module_nsxt_transport_nodes.py", line 239, in main
url_username=mgr_username, url_password=mgr_password, validate_certs=validate_certs, ignore_errors=True)
File "/tmp/ansible_uLVO49/ansible_modlib.zip/ansible/module_utils/vmware.py", line 53, in request
raise Exception (data['error_code'], data)
failed: [localhost] (item=edge-1) => {
"changed": false,
"invocation": {
"module_args": {
"description": "Edge Transport Node for 192.168.110.37",
"display_name": "edge-transp-node-1",
"fabric_node_name": "nsx-t-edge-1.corp.local.io",
"host_switch_spec": {
"host_switches": [
{
"host_switch_name": "hostswitch-overlay",
"host_switch_profile_ids": [
{
"key": "UplinkHostSwitchProfile",
"value": "bdb9bf34-24ca-4319-bb26-1ddf7dab7b59"
}
],
"ip_assignment_spec": {
"ip_pool_id": "b36f3155-3682-49b4-bfef-23ee84a7b79b",
"resource_type": "StaticIpPoolSpec"
},
"pnics": [
{
"device_name": "fp-eth1",
"uplink_name": "uplink-1"
}
]
},
{
"host_switch_name": "hostswitch-vlan",
"host_switch_profile_ids": [
{
"key": "UplinkHostSwitchProfile",
"value": "bdb9bf34-24ca-4319-bb26-1ddf7dab7b59"
}
],
"pnics": [
{
"device_name": "fp-eth0",
"uplink_name": "uplink-1"
}
]
}
],
"resource_type": "StandardHostSwitchSpec"
},
"host_switches": null,
"hostname": "192.168.110.33",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 443,
"resource_type": "TransportNode",
"state": "present",
"transport_zone_endpoints": [
{
"transport_zone_id": "5f4b71f5-a30d-4859-a8ce-13122a11d05f"
},
{
"transport_zone_id": "24dc462a-44e9-4bcb-a3a0-b55809fdb1a9"
}
],
"username": "admin",
"validate_certs": false
}
},
"item": "edge-1",
"msg": "Failed to add transport node. Request body [{\"host_switch_spec\": {\"host_switches\": [{\"pnics\": [{\"uplink_name\": \"uplink-1\", \"device_name\": \"fp-eth1\"}], \"host_switch_name\": \"hostswitch-overlay\", \"ip_assignment_spec\": {\"ip_pool_id\": \"b36f3155-3682-49b4-bfef-23ee84a7b79b\", \"resource_type\": \"StaticIpPoolSpec\"}, \"host_switch_profile_ids\": [{\"key\": \"UplinkHostSwitchProfile\", \"value\": \"bdb9bf34-24ca-4319-bb26-1ddf7dab7b59\"}]}, {\"pnics\": [{\"uplink_name\": \"uplink-1\", \"device_name\": \"fp-eth0\"}], \"host_switch_name\": \"hostswitch-vlan\", \"host_switch_profile_ids\": [{\"key\": \"UplinkHostSwitchProfile\", \"value\": \"bdb9bf34-24ca-4319-bb26-1ddf7dab7b59\"}]}], \"resource_type\": \"StandardHostSwitchSpec\"}, \"display_name\": \"edge-transp-node-1\", \"description\": \"Edge Transport Node for 192.168.110.37\", \"transport_zone_endpoints\": [{\"transport_zone_id\": \"5f4b71f5-a30d-4859-a8ce-13122a11d05f\"}, {\"transport_zone_id\": \"24dc462a-44e9-4bcb-a3a0-b55809fdb1a9\"}], \"node_id\": \"5ab2dcf7-6e19-49b2-a9d4-f245cb36eb96\", \"resource_type\": \"TransportNode\"}]. Error[(15000, {u'error_code': 15000, u'related_errors': [{u'error_code': 16026, u'error_message': u'[Fabric] Edge fabric node 5ab2dcf7-6e19-49b2-a9d4-f245cb36eb96 is not ready yet, current deployment state is NODE_NOT_READY. Please try again later. To check if it is ready, please use fabric node status API.', u'httpStatus': u'BAD_REQUEST', u'module_name': u'FABRIC'}, {u'error_code': 16008, u'error_message': u'[Fabric] Edge 5ab2dcf7-6e19-49b2-a9d4-f245cb36eb96 is not ready for Pnics are not prepared', u'httpStatus': u'BAD_REQUEST', u'module_name': u'FABRIC'}, {u'error_code': 16007, u'error_message': u'[Fabric] Unable to create Transport Node as Edge node 5ab2dcf7-6e19-49b2-a9d4-f245cb36eb96 is not initialized yet. Please try again later.', u'httpStatus': u'BAD_REQUEST', u'module_name': u'FABRIC'}, {u'error_code': 16026, u'error_message': u'[Fabric] Edge fabric node 5ab2dcf7-6e19-49b2-a9d4-f245cb36eb96 is not ready yet, current deployment state is NODE_NOT_READY. Please try again later. To check if it is ready, please use fabric node status API.', u'httpStatus': u'BAD_REQUEST', u'module_name': u'FABRIC'}, {u'error_code': 16008, u'error_message': u'[Fabric] Edge 5ab2dcf7-6e19-49b2-a9d4-f245cb36eb96 is not ready for Pnics are not prepared', u'httpStatus': u'BAD_REQUEST', u'module_name': u'FABRIC'}, {u'error_code': 16007, u'error_message': u'[Fabric] Unable to create Transport Node as Edge node 5ab2dcf7-6e19-49b2-a9d4-f245cb36eb96 is not initialized yet. Please try again later.', u'httpStatus': u'BAD_REQUEST', u'module_name': u'FABRIC'}], u'error_message': u'Found errors in the request. Please refer to the relatedErrors for details.', u'httpStatus': u'BAD_REQUEST', u'module_name': u'FABRIC'})]."
}