set_facts does not work on Mac OSX??

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

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!

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: