Want to pass a json variables containing couple of ansible hosts to a 
ansible-playbook so the variables can be looped in for hosts one by 
one.similar to


---
 - hosts: "{{ item.sample.server }}"
   sudo: true
   tasks:
   - name: print
     debug: msg= "{{ item.sample.jar }} is being deployed to {{ 
item.sample.server }}" 
   - {include: /home/ubuntu/deployment/deployment.yml, "{{item}}" : ["{{ 
item.sample.jar }}", "{{ item.sample.server }}"]}
   with_items: "{{ item }}"

by passing variable by 

   ansible-playbook play.yml --extra-vars 
'item=[{"sample":{"server":"server1"}},{"sample":{"server":"server2"}}]'

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7ee5978e-29c1-481a-98ca-0f8563a3cbce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to