Parsing Password.

unable to parse password. if there is number/int followed “#”
eg.
test.ini
10.10.10.10 ansible_user=admin ansible_password=‘0#d1234’

test.yml

  • name: Print password from inventory
    hosts: all
    gather_facts: false

    tasks:

    • name: Show ansible_password
      ansible.builtin.debug:
      msg: “Password = {{ ansible_password }}”

output:
TASK [Show ansible_password] *******************************************************************************************************************************
ok: [10.10.10.10] => {
“msg”: “Password = 0”

This is a limitation of the ini format, # is considered a comment and you cannot really override that, use YAML instead, also I recommend using a vault for the password.