Entendi! Use um quando:)
pre_tasks:
- name: Take service out of nginx upstream pools
local_action: command {{ playbook_dir }}/scripts/nginx-upstream-management.sh -s {{ item[0] }} -r {{ item[2] }} -g {{ item[1] }}
with_nested:
- groups['nginx_internal_servers']
- services_endpoints.keys()
- ansible_all_ipv4_addresses|last
when: item[0] != inventory_hostname