---
- hosts: localhost
  gather_facts: false
  vars:
      neo4j:
        name: neo4j
      api_service:
        name: api_service
        pid: /var/api/pid
  tasks:  
    - debug:
        msg: 
"{{item.pid|default('/var/run/{{item.name}}/{{item.name}}.pid')}}"
      with_items:
          - "{{ vars[service] }}"

ansible-playbook play.yml --extra-vars service=api-service

how will I debug both dictionaries?
  I know that I can't give 
     --extra-vars service=api-service,neo4j or as a llist

or is there any way to dynamically iterate using user given dictionaries.

-- 
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/3ff1de6d-a7ca-497b-bb2c-308121063a51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to