# set\_facts does not work on Mac OSX??

**URL:** <https://forum.ansible.com/t/set-facts-does-not-work-on-mac-osx/13610>\
**Category:** Ansible Project\
**Created:** [October 4, 2013, 1:02pm UTC](https://forum.ansible.com/t/set-facts-does-not-work-on-mac-osx/13610 "2013-10-04T13:02:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [October 4, 2013, 1:02pm UTC](https://forum.ansible.com/t/set-facts-does-not-work-on-mac-osx/13610/1 "2013-10-04T13:02:41Z")

</div>

Here is what I do on Linux:

- name: set fact  
set\_fact: dbname=‘prod’

- shell: echo {{ dbname }}

Output:

changed: [localhost] =\> {“changed”: true, “cmd”: "echo prod ", “delta”: “0:00:00.004590”, “end”: “2013-10-04 14:59:32.456708”, “rc”: 0, “start”: “2013-10-04 14:59:32.452118”, “stderr”: “”, “stdout”: “prod”}

And exactly the same tasks on Mac gives me:

fatal: [localhost] =\> One or more undefined variables: ‘dbname’ is undefined

ansible version: 1.4 on both Linux and Mac

Edgars

---

<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 4, 2013, 1:24pm UTC](https://forum.ansible.com/t/set-facts-does-not-work-on-mac-osx/13610/2 "2013-10-04T13:24:07Z")

</div>

That’s curious.

set\_facts has nothing about it that is OS X specific or non specific.

Please double check you are on the same version and using the same playbook, and if you think that’s true file a ticket in github and we can see if we can replicate it.

Thanks!

---

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [October 4, 2013, 2:36pm UTC](https://forum.ansible.com/t/set-facts-does-not-work-on-mac-osx/13610/3 "2013-10-04T14:36:21Z")

</div>

Sorry for false alarm, it was indeed issue with my playbook on Mac

Edgars

piektdiena, 2013. gada 4. oktobris 15:02:41 UTC+2, Edgars rakstīja:
