Code Monkey home page Code Monkey logo

ansible-docker-machine-swarm-cluster's Introduction

Docker Machine Swarm cluster with Ansible

This set of ansible playbooks creates a docker swarm cluster with docker-machine and collects afterwards the information for all machines and put them together into a in memory playbook for further provisioning with ansible.

The cluster creation depends on this article.

How to use it

The easiest way is to vagrant up and use the the setup_machines.yml and infra.yml playbooks afterwards. If you have real machines adjust the /ansible/hosts/server_list.yml file. Everything else gets dynamically generated.

Create some vms for testing ...
$ vagrant up 

Or adjust the /ansible/hosts/server_list.yml file with ips of your servers.

First delete old machines (attention this deletes all machines on your system). There mustn't be machines with the names of the new ones.
$ ansible-playbook setup_machines.yml

Setup up the docker-machines on your server
$ ansible-playbook setup_machines.yml

Now install the consul cluster so the swarm can connect.
$ ansible-playbook infra.yml

Check if everything works.
$ eval $(docker-machine env --swarm swarm-master-1)
$ docker info

Attention

cleanup_machines.yml will remove all docker machines on your system and spin up the new ones (if anybody can tell me how to just delete the ones that are in list would be nice). TODO: when it works to clean machines from the server_list.yml put this into the setup_machines.yml

TODOs:

  • Add labels to the nodes for creating specifix containers on specific nodes
  • Make it more dynamic so other drivers except the generic drivers can be used
  • Add Jenkins
  • Add Proxy

Credits:

Viktor Farcic https://github.com/vfarcic - Using some of his roles of his playbooks and mentoring

Jacob Blain Christen https://github.com/dweomer - Article about setting up docker swarm cluster with docker machine

ansible-docker-machine-swarm-cluster's People

Contributors

braunreuthera avatar

Watchers

 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.