Staging and Production on same VPS

Your edit is correct.

You generally want to us Vagrant for dev only. The Vagrantfile just runs the playbook anyway. So you can manually run the Ansible playbook against your staging/prod servers.

bedrock-ansible lets you define multiple WP sites on a server. Although I just realized it’s a little weird with the environment naming right now. For example, by default there’s group_vars/staging and group_vars/production. You’d probably want to just pick production and define 2 sites in there and vary the env.wp_env setting. You’d also need to define the server ip under hosts/production.

You can run the playbook as normal in Ansible like ansible-playbook -i hosts/production site.yml

2 Likes