O'Reilly logo

Security Automation with Ansible 2 by Akash Mahajan, Madhu Akula

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required