I am revisiting code I made 4 years ago for some Day0 ONTAP Builds. I used the na_ontap_info regularly, and am converting to use the na_ontap_rest_info module. I'm having some trouble with using the registered output of it. I assume it's likely just syntax, but I find these kind of issues difficult to search forums/Google for, so am hoping someone here can help.
Here is the task to get the info, this works fine (in this example I just want the failover policy name and the service_policy).
- name: Get Node Management LIFs netapp.ontap.na_ontap_rest_info: <<: *clusterlogin gather_subset: - ip_interfaces_info fields: - 'name' - 'location.failover' - 'service_policy.name' use_python_keys: true register: node_mgmt_lifs tags: node_mgmt_lifs
Here is a snippet of the na_ontap_rest_info output:
"ontap_info": { "network_ip_interfaces": { "num_records": 6, "records": [ { "location": { "failover": "broadcast_domain_only" }, "name": "cluster_mgmt", "service_policy": { "name": "default-management" }, "uuid": "106c4ac0-10d4-11ef-9d9c-005056a095dd" }, { "location": { "failover": "home_node_only" }, "name": "CJCLUSTER-01_mgmt1", "service_policy": { "name": "default-management" }, "uuid": "892e5d80-10cf-11ef-9d9c-005056a095dd" },
Had to split over two messages to get under the 2000 character limit.