I have multiple WordPress Bedrock sites, each in a project folder with site/ and trellis/ subfolder.
For provisioning the server, I would run the server.yml playbook.
Now there is a trellis/ folder for each site and they may differ in version (changes in trellis github repository).
How well are the ansible deployment and provision steps separated?
Can I just run the deployment ansible playbook of a site - what is with differences between the ansible roles/files that were used for provisioning the server and what is now used for deploying (this particular site, trellis/ sub-folder)?
This is very nice because now I can keep trellis as a true cloned repository from GitHub and fetch and merge changes from it, also ensuring the same ansible files are used among all apps being deployed.
I will have a bash, I just wondered what the correct procedure would be to do this.
I can understand that the server.yml would set up the server with all the necessary software and I’m ok with that and using successfully so far.
I can understand the deploy.yml file will deploy said theme and codebase and restart nginx for any particular dev project i have running locally from a git base.
What i need to do if i understand this correctly, is run another deploy from another local dev site to that same server. What I am unsure of is will nginx recognise the second site and will it be setup correctly on that server to handle the second site without having to run another server.yml, which will probably destroy the first site…
My idea is to run a single droplet just for staging sites as they will not be getting much load, and maybe another single droplet for production sites that are very small in size and traffic, thus saving costs etc and management time.
If/when you add a new site to wordpress_sites, you would need to run server.yml just for the letsencrypt role (if you’re using Let’s Encrypt) and the wordpress-setup role. The wordpress-setup creates an nginx conf for your new site. You could add --tags letsencrypt or --tags wordpress to your command to run only these roles. Then you would need to run deploy.sh or deploy.yml to deploy the new site.
Running server.yml or deploy.yml will never destroy any sites on the server.
Explore these threads (and their links) for ideas on multiple sites with one Trellis: