0

I could see in the inventory roleid and secretid created as ansible vault secret so i can use it in my playbook.

secret_id:
  __ansible_vault: >
    $ANSIBLE_VAULT;1.1;AES256
    64306338633133643036396537306534393265626132616165326565656339313535393335326562
    **************

However when I use it in let say to see the value or use it in lookup task, it gives below error

{
    "msg": "An unhandled exception occurred while templating '{{ secret_id }}'. Error was a <class 'ansible.parsing.vault.AnsibleVaultFormatError'>, original message: Vault format unhexlify error: Odd-length string",
    "_ansible_no_log": false
}

I also tried a working ansible vault secret which in debug runs but doesn't show any output which makes sense as you wouldn't want to easily visible in plaintext. But this secret_id fails.

Sid
  • 161
  • 1
  • 10
  • 1
    Does this answer your question? [Ansible-vault errors with "Odd-length string"](https://stackoverflow.com/questions/27787412/ansible-vault-errors-with-odd-length-string) – mdaniel Sep 28 '21 at 02:46
  • Thanks @mdaniel I went through this post as well, it is not related as I am able to use other ansible vault encoded variables but not the roleid. – Sid Sep 29 '21 at 04:05
  • Then you will want to compose an [MCVE](https://stackoverflow.com/help/mcve) that demonstrates your problem using some sample data and a vault password of `password` because as it stands now, no one can _guess_ what's wrong with your setup – mdaniel Sep 29 '21 at 14:53

0 Answers0