How to register facts of remote host using Ansible?
<p>I want to register facts of the remote host into var and then iterate over the var in next task. but I am stuck on first task of registering facts with hostname [hostname:IP]. Following is my code : </p>

<pre><code>- name: get facts
  setup:
  delegate_to: "{{item}}"
  delegate_facts: True
  with_items: "{{ groups['hadoop'] }}"
  register: hadoop_ips
  tags:
    - etc-hosts

- debug: msg={{ hadoop_ips }}
  tags:
    - etc-hosts
</code></pre>