# ansible-vault encrypt /etc/ansible/group\_vars/all.yml  gives me the error Unexpected Exception, this is probably a bug: \[Errno 13\] Permission denied: '/etc/ansible/group\_vars/all.yml'

**URL:** <https://forum.ansible.com/t/ansible-vault-encrypt-etc-ansible-group-vars-all-yml-gives-me-the-error-unexpected-exception-this-is-probably-a-bug-errno-13-permission-denied-etc-ansible-group-vars-all-yml/39971>\
**Category:** Get Help\
**Created:** [February 2, 2025, 10:44am UTC](https://forum.ansible.com/t/ansible-vault-encrypt-etc-ansible-group-vars-all-yml-gives-me-the-error-unexpected-exception-this-is-probably-a-bug-errno-13-permission-denied-etc-ansible-group-vars-all-yml/39971 "2025-02-02T10:44:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheikh\_Musaib](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sheikh_musaib/32/7431_2.png) [@Sheikh\_Musaib](https://forum.ansible.com/u/Sheikh_Musaib)\
**Post date:** [February 2, 2025, 10:44am UTC](https://forum.ansible.com/t/ansible-vault-encrypt-etc-ansible-group-vars-all-yml-gives-me-the-error-unexpected-exception-this-is-probably-a-bug-errno-13-permission-denied-etc-ansible-group-vars-all-yml/39971/1 "2025-02-02T10:44:20Z")

</div>

ansible-vault encrypt /etc/ansible/group\_vars/all.yml gives me the error Unexpected Exception, this is probably a bug: [Errno 13] Permission denied: ‘/etc/ansible/group\_vars/all.yml’

---

<div class="post-metadata">

**Author:** ![gundalow](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gundalow/32/99_2.png) [@gundalow](https://forum.ansible.com/u/gundalow)\
**Post date:** [February 2, 2025, 10:46am UTC](https://forum.ansible.com/t/ansible-vault-encrypt-etc-ansible-group-vars-all-yml-gives-me-the-error-unexpected-exception-this-is-probably-a-bug-errno-13-permission-denied-etc-ansible-group-vars-all-yml/39971/2 "2025-02-02T10:46:35Z")

</div>

Hi,  
Welcome to the forum.

I’m guessing that the user you are running ansible-playbook as doesn’t have permission to read that file.

I would suggest having your Ansible files in a git checkout in the user’s home directory, see this guide

[https://docs.ansible.com/ansible/2.8/user\_guide/playbooks\_best\_practices.html#directory-layout](https://docs.ansible.com/ansible/2.8/user_guide/playbooks_best_practices.html#directory-layout)
