Hi Guys,

    Hope some one can help me out. We are trying to run a ansible playbook 
which checks the give node IP within the pool members node to check the 
Presence. But due to some Pool doesn't have any member node to check, it 
directly stops the code find a empty string to check with. 

Task:
- name: Determine pools the node is in and record their active member counts
      set_fact:
  when: node in item[1]
  loop: "{{ pools | json_query('ltm_pools[].[name, members[*].address]')}}"

fatal: [localhost]: FAILED! => {"msg": "The conditional check 'node in 
item[1]' failed. The error was: Unexpected templating type error occurred 
on ({% if node in item[1] %} True {% else %} False {% endif %}): argument 
of type 'NoneType' is not iterable\n\nThe error appears to be in 
'/root/serverdecom/F5S.yml': line 29, column 7, but may\nbe elsewhere in 
the file depending on the exact syntax problem.\n\nThe offending line 
appears to be:\n\n\n    - name: Determine pools the node is in and record 
their active member counts\n      ^ here\n"}

As while Json_query runs checking with node with member address for a match 
in some pool there is no presence of member address to check with so code 
does not know how to check node with a empty list and the code stops.

Thanks and Regards,
Lokesh M

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/81f983cd-15c5-4b2c-aa49-228484ee189fn%40googlegroups.com.

Reply via email to