Giter VIP home page Giter VIP logo

ansible-rancher's Introduction

Ansible Playbook to start a Rancher cluster on AWS with rancherOS instances

Rancher is a new multi-host Docker management platform. It consists currently of single master node and a set of worker running Docker. The agent running in the worker nodes runs as a Docker container. Rancher builds a network overlay to allow cross-hosts container linking. It has a nice dashboard as well as a programming API and integrates with GitHub for Authentication and Authorization.

Rancher Labs recently announced RancherOS which brings just enough OS to run Docker. It fits in the same realm as coreOS, Ubuntu Snappy and project Atomic. Starting with RancherOS is easy with the vagrant project.

It's pretty certain that Rancher labs will use its own software and run Rancher on rancherOS.

This is an attempt at providing an ansible playbook to start a set of instances on EC2 using rancherOS and deploying Rancher on them.

It should be as easy as:

$ git clone https://github.com/runseb/ansible-rancher.git
$ cd ansible-rancher
$ ansible-playbook rancher.yml

Once the playbook finishes, you will see the IP of the master. Open your browser at http://<IP_OF_MASTER>:8080 and enjoy the UI.

Rancher UI

Of course you will need to have Ansible installed:

$ sudo pip install ansible

You will need an account on AWS, and some API keys properly setup for use with Ansible. Couple Google searches away.

The playbook is simple. It creates a keypair and a security group. The main play can be edited to set the number of nodes etc:

hosts: localhost
  connection: local
  vars:
    ssh_key: rancher
    aws_region: us-east-1
    num_nodes: 5
    security_group_name: rancher
    template: ami-eeaefc86 
    instance_type: m1.small

  roles:
    - common
    - rancher

Note that in the inventory I specify a python interpreter for my localhost, that's because I use OSX. Remove it on linux.

[default]
localhost ansible_python_interpreter=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python

Caveats

During this testing, I encountered a few issues with rancherOS.

  • The cloud-init support is still WIP and it seems to be conflicting with AWS userdata. So if you pass both a keypair and userdata in the roles/rancher/tasks/create_vm.yml the keypair access gets disabled. Therefore comment the userdata lines if you want to be able to ssh into your instance. ticket opened #66
  • Everything is docker in rancherOS, so there is no python, minimal unix commands and most the filesystem is readonly. This means that running ansible adhoc commands will fail, until we can boostrap the instances with some form of python. Something like this but not quite.
  • The AMI for rancherOS are only available in US zones. ticket opened #65
  • The UI is a bit slow to start, so wait ~5 minutes.
  • Auto registration of workers using my own crude userdata way is not working yet.

ansible-rancher's People

Contributors

sebgoa avatar

Watchers

 avatar  avatar

Forkers

qbui rnrbarbosa

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.