Giter Site home page Giter Site logo

ansible-push's Introduction

ansible-push

Use Ansible to deployments to multiple EC2, the IP list can be generated by bash script calling awscli

Why ansible ? What's the meaning of Configuration Management?

Assume you manage multiple group of VMs across GCP, AWS and Azure like below and you want to efficiently deploy the specified versions to them several times a week.

stage: 1 api and 2 workers using aws ec2

prod1: 2 api and 10 workers using gcp vm

prod2: 2 api and 5 workers using azure vm

To manage the versions of your services on the above groups need a powerful tool to manage the configuration and execute some script as needed. Then below steps will make your life easier:

* Install ansible on your local 
* Create hosts list with specified ssh private key on your local folder ansible/hosts.ini
* Specify service versions in ansible/service/versions.json
* Maintain secrets and other configurations in ansible/service/config.json
* Develop script ansible/service/run.sh for how to download and launch the services on remote server
* Copy updated files (versions.json, config.json, run.sh) from local to remote server by ansible playbook
* Excute the script at remote servers to launch the services defined in the playbook

Diagram1

Problem to resolve:

How to get a list of public(private) IPS by tag or from a scaling group of EC2 ?

Refer to the script ec2-ips.sh

Feature 1: Get a list of instance ids via describe a scaling group, then get the IP for each instance via describe isntance.

Feature 2: Get a list of instances by --filter option on describe instance by tag.

How to deploy to stage first and then to prod after testing on stage ?

Step 1: create stage and prod groups in hosts.ini

Step 2: create makefile with different deploy commands

Step 3: run below lines to deploy separately

make stg
make prod

More information:

  • Install ansible on ubuntu from ppa
refer to https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-16-04
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
ansible --version

ansible-push's People

Contributors

jimmycgz avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

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.