From what I’ve understood, Ansible replaces Capistrano if you want to use it to setup your development and production servers.
I have my own VPS that has cPanel to manage multiple user accounts (technically making my VPS a shared hosting environment with SSH access).
I would love to use Ansible to only to deploy to one of the cpanel accounts, not to setup the whole server; after the first reply I will want to keep it updated using Ansible.
Is this viable? If so where to start?
Should I really use Capistrano? (I’ve tried but I do not like it, Ansible seems much more friendly).
It should be possible. I do intend to split out the deploy role to make this easier. There’s a placeholder issue for it.
Are your sites Bedrock-based or not? It would definitely take more work for non-Bedrock sites.
Basic steps would be:
- Follow normal installation
- Add your server to a
- Configure the matching
group_vars file to define a site under
wordpress_sites (these settings should match up with your existing WP install)
- Just run the deploy command/playbook
You could get away with only defining the minimum set of variables for a WP site. Something like this:
local_path: '../site' # path targeting local Bedrock site directory (relative to Ansible root)
# env section only needed if you need to generate a `.env` file
# Generate your keys here: https://api.wordpress.org/secret-key/1.1/salt/
If your site isn’t Bedrock based, it would take more work to override some defaults in the
You’d also have to manually figure out adding SSH keys but that’s the same as Capistrano.
Thank you @swalkinshaw, this is exactly what I was looking for… and a lot more simple than what I was messing with.
I’d love to try this too
@apintocr Did you get it to work?