Q: How to access Ansible output as input parameters to it I am geting Ansible output like this.
ok: [localhost] => {
"ansible_facts": {
"filter3": [
    "id = 1",
    "type = DM",
    "status = started",
    "provisioning = completed",
    "build = yes",

My requirement is to use this output as parameters in ansible scripts.
for example id as variable name and 10001 as value to the id.
Here I'm following the way like, I'm Storing output to a file like 
[prod]
id = 1
type = DM
status = started
provisioning = completed
build = yes

and I'm accessing like 
- set_fact: id="{{ lookup('ini', 'id section=prod file=/home/var.properties') }}"
- set_fact: provisioning="{{ lookup('ini', 'provisioning section=prod file=/home/var.properties') }}"
- set_fact: build="{{ lookup('ini', 'build section=prod file=/home/var.properties') }}"

There will be a chance of getting some more extra parameters in output in future. so every time I have to add the code at set_fact to access these parameters.
so to avoid this, I would have to access these parameters directly from the output and use it in the next task execution. Please help me on this.

A: I'm not sure to understand your question, but basically, what you are looking for is the use of Register.
They work the same way than facts, but are more flexible if you have dynamic content.
Then, you can use the query language to access any part of the register.
(Online syntax tester : http://jmespath.org/tutorial.html)
Example :
---
- name:  List packages
  shell: /usr/bin/dpkg-query -l '*{{ item }}*' | grep '^ii ' | awk 'BEGIN { OFS = "-" } { print $2,$3,$4 }'
  with_items: 
    - openssh
    - openssl
    - vim
    - python
  failed_when: false
  register: pkg

- debug:
    msg: |
      {{ "Installed packages found #" | comment('plain', prefix='############################', postfix='############################')}}
      {{ pkg | json_query(query) | to_nice_yaml }}
  vars:
    query: "results[].{name: item, version: stdout_lines}"
...

