Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Latest commit

 

History

History
44 lines (31 loc) · 1.01 KB

README.md

File metadata and controls

44 lines (31 loc) · 1.01 KB

docker-swarm-playground

A Vagrant environment for testing Docker Swarm mode in Docker 1.12.

NOTE: This project is mainly meant for (me) testing how to set up a cluster in swarm mode with Ansible. If you want to only test the new features of v1.12, it's almost always better to just use Docker Machine via Docker Toolbox.

Requirements

  • Vagrant
  • Virtualbox
  • Ansible

Setup

ansible-galaxy install -r roles.yml
vagrant up
ansible-playbook install-docker.yml
# Because of a bug in the jzmch.ansible-docker role, you have to reload the servers so Ansible can find the docker daemon.
# I will fix this soonish.
vagrant reload
ansible-playbook initialize-cluster.yml

Checking if everything is setup

ansible managers -m shell -a "docker node ls"

Adding new worker nodes

Add them to inventory

[workers]
new_worker ansible_host=<ip>

Run add-worker-nodes.yml playbook

ansible-playbook add-worker-nodes.yml