# gathering facts problem

**URL:** <https://forum.ansible.com/t/gathering-facts-problem/14593>\
**Category:** Ansible Project\
**Created:** [February 18, 2014, 7:47pm UTC](https://forum.ansible.com/t/gathering-facts-problem/14593 "2014-02-18T19:47:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cong](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@Cong](https://forum.ansible.com/u/Cong)\
**Post date:** [February 18, 2014, 7:47pm UTC](https://forum.ansible.com/t/gathering-facts-problem/14593/1 "2014-02-18T19:47:57Z")

</div>

This is my playbook (dbmaster.yml)

- hosts: dbmasters  
remote\_user: root

roles:

- common
- dbmaster

if I run this. it will work fine  
sudo -u test ansible-playbook dbmasters.yml

however if I run it on one specific host (host1)

sudo -u test ansible-playbook dbmasters.yml -l host2

I got error in one task

fatal: [host2] =\> {‘msg’: “One or more undefined variables: ‘dict’ object has no attribute ‘ansible\_eth0’”, ‘failed’: True}

this is because it needs this variable from host1

I tried gather\_facts=yes and it does not work  
I tried serial=1. This will work one host at a time but there is no option to stop on the first host.

any idea who to run on one host and get facts from both hosts or will serial=1 stop at the first host.

I read ansible doc [http://docs.ansible.com/guide\_rolling\_upgrade.html](http://docs.ansible.com/guide_rolling_upgrade.html) and also tried this option

```auto
- hosts: dbmasters
  tasks: []

```

```auto

- hosts: dbmasters
  remote_user: root

  roles:
    - common
    - dbmaster

with a blank task but it does not work either.

```

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [February 19, 2014, 1:24am UTC](https://forum.ansible.com/t/gathering-facts-problem/14593/2 "2014-02-19T01:24:17Z")

</div>

Answer in this thread:

[https://groups.google.com/forum/#!topic/ansible-project/XbRcz6zCbCw](https://groups.google.com/forum/#!topic/ansible-project/XbRcz6zCbCw)
