A simple ansible playbook which demonstrates how to handle the failure of a consul datacenter (in a distributed WAN setup) by using a plugin.
$ ansible-playbook -i localhost site.yml
This playbook:
- Sets up a 3 datacenter consul setup:
- alpha
- beta
- gamma
-
Runs consul-template and validates that all 3 datacenters are mentioned in the outputted template.
-
Stops 2 of the 3 servers in the beta datacenter (thereby causing the cluster to lose consensus).
-
Runs consul-template and validates that the
alpha
andgamma
dataceters are mentioned in the outputted template, and that thebeta
datacenter is not present in the outputted template.