Vagrant up permission denied when running ansible-galaxy

I’ve been working with an older version of trellis for a while without any issues when running vagrant up. i am starting development on a new project (fresh trellis/bedrock clone) and when i run vagrant up i get this error during provisioning when it hits Running ansible-galaxy:

ERROR! Unexpected Exception: [Errno 13] Permission denied: '/Users/UserName/.ansible_galaxy'
to see the full traceback, use -vvv
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

ansible roles installed without any issues.

If i change the permissions to the .ansible_galaxy file, I get a different error at the same spot:

- downloading role 'composer', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-composer/archive/1.5.0.tar.gz
- extracting composer to /Users/UserName/Sites/example.com/trellis/vendor/roles/composer
 [WARNING]: - composer was NOT installed successfully:
/Users/Chris/Sites/TW/trellis/vendor/roles/composer doesn't appear to contain a
role.   please remove this directory manually if you really want to put the
role here.

ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

managed to resolve this by removing the .ansible_galaxy file and re-installing the ansible requirements without sudo (which i had to do the first time because of the incorrect permissions on the .ansible_galaxy file).

once i did that, provisioning was a success

4 Likes