I still have my problem to use ansible-vault command with a non root user and got an error message. Works great with root user.
I have done a ton of tests with different installations method (rpm file, pip install module) and a lot of access rights on files, and different users but still stuck on this :(.
Same python version, rpm etc for both users/root
Any help would be apprecied :) !
[myuser@server:~]$ python3 -m pip show cryptography
Name: cryptography
Version: 36.0.1
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
Author: The Python Cryptographic Authority and individual contributors
Author-email: cryptography-dev@python.org
License: BSD or Apache License, Version 2.0
Location: /usr/lib64/python3.9/site-packages
Requires: cffi
Required-by: ansible-core
[1]+ Done code
[myuser@server:~]$ ansible-vault --version
ansible-vault [core 2.12.2]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/myuser/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
ansible collection location = /home/myuser/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible-vault
python version = 3.9.10 (main, Feb 9 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)]
jinja version = 2.11.3
libyaml = True
[myuser@server:~]$ ansible-vault view /home/myuser/Password.yml
Vault password:
ERROR! ansible-vault requires the cryptography library in order to function for /home/Password.yml