BlueGreen deployment setup playbook

The following playbook will set up three nodes, which includes load balancer and two web server nodes. Follow https://www.upcloud.com/support/haproxy-load-balancer-ubuntu to create a playbook.

The following snippet is the inventory file:

[proxyserver]proxy ansible_host=192.168.100.100 ansible_user=ubuntu ansible_password=passwordgoeshere[blue]blueserver ansible_host=192.168.100.10 ansible_user=ubuntu ansible_password=passwordgoeshere[green]greenserver ansible_host=192.168.100.20 ansible_user=ubuntu ansible_password=passwordgoeshere[webservers:children]bluegreen[prod:children]webserversproxyserver

Then, the main.yml playbook file looks like the following, which describes what roles to execute on which ...

Get Security Automation with Ansible 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.