Giter VIP home page Giter VIP logo

ansible-bluegreen-docker's Introduction

Ansible Role: ansible-bluegreen-docker

Build Status

Simple Ansible role showing concept of blue-green deployments on local microinfrastructure with Docker containers

Role Variables

  • app_bluegreen - Flag to enable or disable blue-green deployments (default: True)
  • app_check_health - Should we check application health in containers before reloading nginx or not. (default: True)
  • app_health_check_path - URL path for health check. (default: /)
  • app_command - Start-up command for container.
  • app_env - Dictionary of ENV variables to be available in conainer. Used for set-up application in container. (default: {})
  • app_etc_hosts - Dictionary of custom host:ip mappings for /etc/hosts in container. Used for unified 3rd party services endpoints accross different envs. (default: {})
  • app_hostname - Hostname used in nginx config as server_name. (default: localhost)
  • app_instances_count - Number of containers to be run on single host. (default: 2)
  • app_log_driver - Log driver for docker containers. (default: none)
  • app_log_options - Dictionary with options for docker log driver. (default: { tag: {{ app_name }} })
  • app_name - Application name. Used for pulling containers from registry and container naming. (default: trainingwheels)
  • app_nginx_port - Port where nginx balancer is listening to. (default: 80)
  • app_nginx_ip_hash - Enable ip-hash load-balancing algorithm for nginx. (default: False)
  • app_port - TCP port where app is listening to. Usually it's port in EXPOSE. (default: 5000)
  • app_stop_inactive_color - Whether stop inactive instances after successful deployment or not. (default: True)
  • app_repo - Repository in docker registry to take image from.
  • app_version - Image version to install. (default: latest)
  • app_volumes - Array with volumes mounted in container. Used for storing peristent data. (default: [])

For more variables see defaults/main.yml

Requirements

  • docker-engine (not in meta)
  • nginx (not in meta)

Nginx balancing

  1. Ansible get a list of all published ports in containers.
  2. Ansible prepare a nginx config with all published container's ports of all(!) app hosts.

Desired architecture

architecture diagram

License

MIT / BSD

ansible-bluegreen-docker's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.