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