Hi,

can you try "with_fileglob" ? Refer in 
http://docs.ansible.com/ansible/latest/playbooks_loops.html#id4


Vào 07:01:51 UTC+7 Thứ Sáu, ngày 02 tháng 2 năm 2018, Andrew Morgan đã viết:
>
> Hello all,
>
> I have a play I want to run wich deletes all hosts matching a certain 
> criteria:
>
> tasks:
>   - name: Delete unavailable nodes
>     zabbix_host:
>      server_url: http://zabbix.aa.net/zabbix
>      login_user: Admin
>      login_password: aq!
>      host_groups: Discovered hosts
>      status: disabled
>      state: absent
>      host_name: "{{ item }}"
>     with_items:
>      - ip-10-1-*-*.us-west-2.compute.internal
>     
>
>
> The above doesnt work, but if I list out the items
> with_items:
>      - ip-10-1-65-27.us-west-2.compute.internal
>      - ip-10-1-65-28.us-west-2.compute.internal
>      - ip-10-1-65-37.us-west-2.compute.internal
>
> then it works, but I want it to be dynamic and find all ips matching      
> - ip-10-1-*-*.us-west-2.compute.internal
>
> any help please?
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6d65b753-fb74-4302-81db-dd64acb3c062%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to