Hello,


Ansible_version: 1.9.2 stable

I have a custom fact, generated via bash:

#!/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:

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

 (note: the above is obfuscated)

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

"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?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b50a42e8-17a8-4b59-948b-41264e5b763c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to