Since # is considered as a comment in /etc/ansible/hosts I'm unable to use a password containing a sharp.
[hosts]
host1 ansible_ssh_user=user ansible_ssh_pass=userpass ansible_su_pass=My#Password
Then with a raw command:
$ ansible host1 -m raw -a "whoami" --su
host1 | FAILED | rc=1 >>
su: Authentication failure
If I use a password without a # it works fine. Is there a workaround to this ?