So I'm most definitely misunderstanding things.
I'm trying to grab every vserver name on a cluster, I've got the below playbook for learning purposes.
But every time I try and drill down past svm/svms and snag just the name. It vomits with the bottom error - I know I'm doing something wrong but I don't know what.
- name: Gather Vserver names
netapp.ontap.na_ontap_rest_info:
hostname: "{{ datacenter['nas']['hostname'] }}"
username: "{{ datacenter['nas']['username'] }}"
password: "{{ datacenter['nas']['pass'] }}"
gather_subset:
- "vserver_info"
validate_certs: false
register: results - debug:
msg: "{{ results['ontap_info']['svm/svms']['records']['name'] }}"
ASK [debug] *******************************************************************
task path: /tmp/rundeck/ansible-runner1511451917696604844playbook:25
ok: [HOST] => {
"msg": [
{
"_links": {
"self": {
"href": "/api/svm/svms/13c0daf1-a993-11ea-91c7-00a098fd51a6"
}
},
"name": "vserver1",
"uuid": "13c0daf1-a993-11ea-91c7-00a098fd51a6"
},
{
"_links": {
"self": {
"href": "/api/svm/svms/172de4df-bbc0-11ea-91c7-00a098fd51a6"
}
},
"name": "vserver2,
"uuid": "172de4df-bbc0-11ea-91c7-00a098fd51a6"
},
{
"_links": {
"self": {
"href": "/api/svm/svms/5171e6da-c6b5-11ea-91c7-00a098fd51a6"
}
},
"name": "vserver3",
"uuid": "5171e6da-c6b5-11ea-91c7-00a098fd51a6"
},
fatal: [HOST]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'list object' has no attribute 'name'. 'list object' has no attribute 'name'\n\nThe error appears to be in '/tmp/rundeck/ansible-runner7276113403921335480playbook': line 25, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n register: results\n - debug:\n ^ here\n"}