intersight-ansible
intersight-ansible copied to clipboard
Support lookup of MoID by reference Org/Name inside the rest_api module
It would be great if the module would be able to automatically lookup the MoID of the object we are trying to reference.
Currently you need 1 task to lookup the MOID based on the filters you specify and then you can use that MoID in the body of your rest_api post.
Current behavior - the referenced MOID would need to be collected first with another task.
api_body: {
"Name": "boris",
"VlanId": "10",
"MulticastPolicy": "{{ Multicast_moid }}",
"AutoAllowOnUplinks": true,
"IsNative": false,
"EthNetworkPolicy": "{{ vlan_policy }}"
}
We would like to do
api_body: {
"Name": "boris",
"VlanId": "10",
"MulticastPolicy": [MoRef:ORG_NAME\PolicyName],
"AutoAllowOnUplinks": true,
"IsNative": false,
"EthNetworkPolicy": [MoRef:Boris\vlans]
}
Then the module would go and collect that MoID in the background and replaces it inside the body we are going to post.