2.2.3. Simulate Blue Green Updates

This demonstrates a very simple example to provide continuous updates.

Note

You need to store passwords for use in Ansible. Use ansible-vault. The ansible-vault command has three subcommands that are frequently used.

  • create
  • edit

Type ansible-vault edit creds.yaml to modify the vault. You will be prompted for vault password before editor opens vault file. The current password is password.

  1. Run this playbook to offline a pool member 10.1.20.17.

    • Type ansible-playbook playbooks/offline.yaml -e @creds.yaml --ask-vault-pass -e pool="hack11_pl" -e pmhost="10.1.20.17" -e pmport="80". You will be prompted for the vault password. The current password is password.
  2. Verify if pool member 10.1.20.17 is forced offline

    • Select Local Traffic -> Pools -> Pool List -> hack11_pl -> Members
    ../../_images/image035.png
  3. Run this playbook to update app on 10.1.20.17.

    • Type ansible-playbook playbooks/blue.yaml --tags 17blue
  4. Run this playbook enable pool member 10.1.20.17.

    • Type ansible-playbook playbooks/enable.yaml -e @creds.yaml --ask-vault-pass -e pool="hack11_pl" -e pmhost="10.1.20.17" -e pmport="80"
  5. Verify if pool member 10.1.20.17 is enabled

    • Select Local Traffic -> Pools -> Pool List -> hack11_pl -> Members
  6. Run this playbook to offline a pool member 10.1.20.20.

    • Type ansible-playbook playbooks/offline.yaml -e @creds.yaml --ask-vault-pass -e pool="hack11_pl" -e pmhost="10.1.20.20" -e pmport="80"
  7. Verify if pool member 10.1.20.20 is forced offline

    • Select Local Traffic -> Pools -> Pool List -> hack11_pl -> Members
  8. Run this playbook to update app on 10.1.20.20.

    • Type ansible-playbook playbooks/blue.yaml --tags 20blue
  9. Run this playbook enable pool member 10.1.20.20.

    • Type ansible-playbook playbooks/enable.yaml -e @creds.yaml --ask-vault-pass -e pool="hack11_pl" -e pmhost="10.1.20.20" -e pmport="80"
  10. Browse to https://10.1.10.11 to test Application. Hackazon image should be blue.

    ../../_images/image099.png