Closed hmmlopez closed 2 years ago
When I encrypt a string with this module and try to decrypt it again with ansible-vault I get (...) three dots at the end of my secret value.
vault = Vault("pass123") with open("test.yaml", "w") as f: f.write(vault.dump("super_secret_password"))
And then I try to decrypt it with ansible-vault: ansible-vault decrypt test.yaml
ansible-vault decrypt test.yaml
I get the following output:
super_secret_password ...
or super_secret_password\n...\n to be more precise.
super_secret_password\n...\n
I was expecting just super_secret_password to be returned.
super_secret_password
I'm using:
ansible-vault [core 2.13.6] config file = None python version = 3.9.15 (main, Oct 12 2022, 19:14:37) [GCC 11.2.0] jinja version = 3.1.2 libyaml = True
and python:
ansible==6.6.0 ansible-core==2.13.6 ansible-vault==2.1.0
Is there something I'm missing, maybe a setting in this module to disable this (...) explicit end funtionality.
Never mind, found the solution after looking into the Vault code, I should have used vault.dump_raw() method.
vault.dump_raw()
When I encrypt a string with this module and try to decrypt it again with ansible-vault I get (...) three dots at the end of my secret value.
And then I try to decrypt it with ansible-vault:
ansible-vault decrypt test.yaml
I get the following output:
or
super_secret_password\n...\n
to be more precise.I was expecting just
super_secret_password
to be returned.I'm using:
and python:
Is there something I'm missing, maybe a setting in this module to disable this (...) explicit end funtionality.