# Local fact not passed

**URL:** <https://forum.ansible.com/t/local-fact-not-passed/19459>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 7, 2015, 9:56pm UTC](https://forum.ansible.com/t/local-fact-not-passed/19459 "2015-10-07T21:56:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ticktockhouse](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ticktockhouse/32/8278_2.png) [@ticktockhouse](https://forum.ansible.com/u/ticktockhouse)\
**Post date:** [October 7, 2015, 9:56pm UTC](https://forum.ansible.com/t/local-fact-not-passed/19459/1 "2015-10-07T21:56:10Z")

</div>

Hello,

Ansible\_version: 1.9.2 stable

I have a custom fact, generated via bash:

```auto

#!/bin/bash 
MYSQL_PW=$(cat /etc/psa/.psa.shadow)

cat << EOF
{
 "pw":"$MYSQL_PW"
}
EOF

```

When I run this on the command line, it gives the expected output:

```auto

{
"pw":"$AES-128-xxxx$xxxxxxxxxxxxxxxxxxx$xxxxxxxxxxxxxxxxxxx"
}

```

(note: the above is obfuscated)

However when I use the setup module, the value of “pw” is empty:

```auto

"ansible_local": {
     "mysql": {
        "pw": ""
       }
}

,

```

I tested this by catting another file, and this gave the expected string when ran standalone and via the setup module:

`  
…  
MYSQL\_PW=$(cat /usr/local/psa/version)  
…

`

gives

`

“ansible\_local”: {  
“mysql”: {  
“pw”: “12.0.18 Ubuntu 14.04 1200150817.13”  
}  
}  
`

``

which is what we expect. I think the error is due to the presence of “$” in the output of the first fact-generating script, but I’m not sure how to get round this.

Does anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![Vikas\_Kumar](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Vikas\_Kumar](https://forum.ansible.com/u/Vikas_Kumar)\
**Post date:** [October 8, 2015, 4:35pm UTC](https://forum.ansible.com/t/local-fact-not-passed/19459/2 "2015-10-08T16:35:19Z")

</div>

Hi Jerry,

Did you reloaded the local facts in your tasks before trying to use the facts.

`

- local\_action: setup filter=ansible\_local  
`

Regards,  
Vikas
