wunderio / WunderMachina

Vagrant & Ansible stuff to build up virtual environment on your local
MIT License
6 stars 8 forks source link

Update nginx/sslterminator provisioning to test the configuration before restarting service. #298

Open evilfurryone opened 6 years ago

evilfurryone commented 6 years ago

Mistakes happen and occasionally a typo when provisioning nginx/sslterminator roles can cause the service restart to fail and the live sites to go down as well. At that moment the stress level goes goes up exponentially until you figure out the problem and re-provision the roles.

We could implement a nginx configuration test to be done before service restart. So nginx -t check and if it was successful allow for the restart otherwise just fail provisioning. Site(s) will stay up and the provisioner can fix the error and try again.

tharna commented 6 years ago

Would also make sense to test Varnish in similar way with varnishd -C -f /etc/varnish/Default.vcl