Role for creating/managing a Docker Swarm cluster
Tested only on CoreOS
$ ansible-galaxy install petalmd.docker-swarm
---
- name: Docker Manager
hosts: docker-manager
gather_facts: True
roles:
- defunctzombie.coreos-bootstrap
- { role: docker-swarm, step: boostrap-manager-steps }
- name: Docker Worker
hosts: docker-worker
roles:
- defunctzombie.coreos-bootstrap
- { role: docker-swarm, step: boostrap-worker-steps }
# Hosts group are created when boostrap-worker-steps and boostrap-manager-steps run
- name: Docker Manager boostrap
hosts: docker-manager-boostrap
roles:
- { role: docker-swarm, step: manager-boostrap }
- name: Retreive the join token
hosts: docker-manager-operational[0]
roles:
- { role: docker-swarm, step: retreive-join-token }
- name: Join - manager nodes
hosts: docker-manager-boostrap:!docker-manager-operational
roles:
- { role: docker-swarm, step: join-manager-nodes }
- name: Docker Worker boostrap
hosts: docker-worker-boostrap
roles:
- { role: docker-swarm, step: docker-worker-boostrap }
- name: Join - worker nodes
hosts: docker-swarm-worker-bootstrap
roles:
- { role: docker-swarm, step: worker-bootstrap }
Contributions, questions, and comments are all welcomed and encouraged!
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D