- name: Show registered var group_info and vm_name
ansible.builtin.debug:
msg:
- "group_info: {{ group_info }}"
- "vm_name: {{ vm_name }}"
It would be helpful to include the job log for the relevant section
of your playbook as well. You say you are trying to parse "the list
variable" but you don't say what that variable is or show what it
contains. Please help us help you.--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/08b16ee1-1087-4b0a-21f7-be65df5dc199%40gmail.com.
- name: Show registered var group_info and vm_name
ansible.builtin.debug:
msg:
- "group_info: {{ group_info }}"
- "vm_name: {{ vm_name }}"TASK [Show registered var group_info and vm_name] **************************************************************
ok: [NED-TST1x] => {
"msg": [
"group_info: {'failed': False, 'drs_group_info': {'NED-Cluster': [{'group_name': 'NED-HOST001-HG', 'hosts': ['ned-host612-hyp'], 'type': 'host'}, {'group_name': 'VM2-on-dev', 'vms': ['deep-test', 'NED-DEV601-X'], 'type': 'vm'}, {'group_name': 'VM2-on-uat', 'vms': ['NED-TST601-X'], 'type': 'vm'}]}, 'changed': False}",
"vm_name: NED-TST601-X"
]
}
Thanks & Regards
Deepak Kumar
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/61ff8b55-dd13-4cd2-b718-11eb1fd28cb1n%40googlegroups.com.
name: set fact specific VM group
ansible.builtin.set_fact:
vm_groups: “{{ group_info.drs_group_info[vcenter_env.cluster] | selectattr('type', '==', "vm" ) | list }}”
name: set fact specific VM group
ansible.builtin.set_fact:
vm_groups: "{{ group_info.drs_group_info[vcenter_env.cluster] | selectattr('type', '==', 'vm' ) | list }}"
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAF%3DeWbLmw9m8qg%3DQ0Pu%2BMaajK1H3fmpCxYe-7_-AviOWTNu2sA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1587F975-D826-4DAF-8F4F-222E344F16EE%40nist.gov.