Hi,
Hoping you can help me with an issue. I’m an Ansible newbie, and have recently jumped in at the Trellis end.
I am provisioning and deploying to a VM on Google Cloud, and that’s working well (thank you for previous assistance). I have also set up a Google SQL instance to host the database separately and, with the help of your docs, got that working too.
However, I’m now trying to get our uploads directory onto a persistent disk attached to the VM, and am having difficulties.
I have a mount point for the disk at /mnt/disks/asc-uploads/. I moved all our images into that, so that they’re now sitting within /mnt/disks/asc-uploads/uploads/2017/. I have changed the ownership on all directories to web, with group www-data.
My group-vars/staging/main.yml now looks like this:
mysql_root_password: "{{ vault_mysql_root_password }}" # Define this variable in group_vars/staging/vault.yml
# Get the uploads link to point to our images stored in the persistent disk.
project_shared_children:
- path: web/app/uploads
src: /mnt/disks/asc-uploads/uploads
But of course (and I guess the “children” part should have been a clue) “src” is actually meant to be a relative rather than an absolute path, so that after deployment I end up with this:
mclarke@asc-staging:/srv/www/australiascience.tv/current$ ls -l web/app/
total 16
drwxr-xr-x 2 web www-data 4096 Oct 27 05:41 mu-plugins
drwxr-xr-x 7 web www-data 4096 Nov 2 00:45 plugins
drwxr-xr-x 3 web www-data 4096 Oct 27 05:41 themes
lrwxrwxrwx 1 web www-data 66 Nov 2 00:45 uploads -> /srv/www/australiascience.tv/shared//mnt/disks/asc-uploads/uploads
Clearly project_shared_children is not the way to go.
I’m hoping to do this properly and updating the link manually seems like a bad idea, so:
- Is there any other way to do this within the Trellis configuration? or
- Should I read up on deployment hooks and update the link using those?
Thanks in advance for any suggestions!