Deploying a Bedrock site with Ansible


I’ve been trying to deploy a site with built with Bedrock with Ansible. I executed the command:

./ staging

The deploy keeps failing at TASK: [deploy | Clone project files] with the following error message:

msg: fatal: could not create work tree dir ‘/srv/www/’.: Permission denied

What am I missing here? You’re help will be so much appreciated.

This shouldn’t be happening obviously.

Make sure that your deploy.yml playbook is using the web_user:

If it is, you can start by looking at the permissions:

ls -la /srv/www/
ls -la /srv/www/

Hi @swalkinshaw, thanks for the answer. I’ve now added the web user to the deploy group that is the owner of my site as I deployed with Capistrano earlier.

Now the Ansible deploy process goes further, but it breaks at the end at

TASK: [deploy | Finalize the deploy]


OSError: [Errno 13] Permission denied: /srv/www/

This is wierd since /srv/www/ is a symlink that has 777 permissions and, what is more, it’s owned by the deploy user that is the owner.

Since permissions were broken before you should probably wipe the whole /srv/www directory and let Ansible re-create it to ensure it’s all correct.

Symlinks always show 777, but the permissions are the same as the folder they’re symlinking, they’re not actually 777