Closed mgoetze5 closed 4 years ago
The primary job of the ansible.cfg under the repo is to point the utils directory to be included in the module_utils path. I wonder how yours is working without it if you are only using your default cfg. Did you copy the line that looks like
module_utils = utils
to your cfg file?
Yes, I have module_utils = ./brocade/utils in mine.
ok. that makes sense.
I am reluctant to simply get rid of the cfg file since, if I get rid of the ansible.cfg file, I believe that is going to mess up other users that are running the playbook as downloaded. I think it may be better to figure out what is going on here and see some other changes are needed.
Based on how I under this, you are doing something like this
cd /root/ansible ansible-playbook -i xxx playbook/distribute_ssh_key.yml
and your ansible.cfg under /root/ansible has module_utils set to ./brocade/utils
are you having trouble with vault only or other troubles as well if ansible.cfg is still under /root/ansible/brocade directory?
Thanks.
Any updates on the last question? Has this issue been resolved on your side?
Hey Daniel, sorry this has been a bit of a Heisenbug, I reinstated the ansible.cfg in your repository so I could try to trace why it was being used and then the problem just didn't occur again. I guess you can close this one if you like and I'll let you know if I have more problems in the future.
Let's go ahead and close the issue for the moment. Let's open another issue if you do run into the issue again to follow up. Thanks.
Some context: I have this repo checked out under /root/ansible/brocade, and I have my configuration under /root/ansible/ansible.cfg. Among other things this sets vault_identity_list. This works fine for my vault encrypted variables under /root/ansible/host_vars.
However, when I try to encrypt something in /root/ansible/playbooks/distribute_ssh_keys.yaml and call it from (working directory) /root/ansible, I get this error:
fatal: [fcsw-gts-b1]: FAILED! => {"msg": "An unhandled exception occurred while templating '{u'fos_password': u'{{fos_password}}', u'fos_ip_addr': u'{{fos_ip_addr}}', u'https': u'self', u'fos_user_name': u'{{fos_username}}'}'. Error was a <class 'ansible.parsing.vault.AnsibleVaultError'>, original message: Decryption failed (no vault secrets were found that could decrypt)"}
Deleting /root/ansible/brocade/ansible.cfg solves the problem and causes my playbook to work as expected.
I don't know why ansible is choosing the ansible.cfg from your repository, but somehow it is, so it would make my life easier if there were no ansible.cfg in your repository.