# Strange behavior with set\_fact

**URL:** <https://forum.ansible.com/t/strange-behavior-with-set-fact/13620>\
**Category:** Ansible Project\
**Created:** [October 7, 2013, 11:55am UTC](https://forum.ansible.com/t/strange-behavior-with-set-fact/13620 "2013-10-07T11:55:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Trudel](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@Marc\_Trudel](https://forum.ansible.com/u/Marc_Trudel)\
**Post date:** [October 7, 2013, 11:55am UTC](https://forum.ansible.com/t/strange-behavior-with-set-fact/13620/1 "2013-10-07T11:55:58Z")

</div>

Greetings,

I am having one really weird behavior that I cannot seem to be able to explain with set\_fact.

Consider this YML file in one of my role:

[https://gist.github.com/stelcheck/6866552](https://gist.github.com/stelcheck/6866552)

For some reason, if I try to run this on two machines, I get this (bootstrap set to false):

TASK: [If undefined set bootstrap to the first node of the cluster] \*\*\*\*\*\*\*\*\*\*\*  
\<172.16.0.81\> ESTABLISH CONNECTION FOR USER: vagrant  
\<172.16.0.80\> ESTABLISH CONNECTION FOR USER: vagrant  
ok: [node2.couchbase1.dev] =\> {“ansible\_facts”: {“bootstrap”: “node1.couchbase1.dev”}, “item”: “”}  
ok: [node1.couchbase1.dev] =\> {“ansible\_facts”: {“bootstrap”: “node1.couchbase1.dev”}, “item”: “”}

TASK: [Check if the current machine is part of the cluster] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
skipping: [node1.couchbase1.dev]

In fact, I can add a number of tasks after this set\_fact and only the last task of the file will end up running on both servers (eg, skip node1 like in this example - and fail in one case since the register is\_member wont be present in one case).

If I remove set\_fact, all the tasks will run properly.

Anyone ever experienced this (using ansible 1.3.1)?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 8, 2013, 2:54pm UTC](https://forum.ansible.com/t/strange-behavior-with-set-fact/13620/2 "2013-10-08T14:54:54Z")

</div>

I do not see why this attribute would be skipped.

If you can pare this down to a minimum example (something that just uses “echo” maybe versus the site-specific shell command) I’d be happy to try to reproduce over here.

Please file a github ticket if you do so we don’t lose this.

Thanks!
