Create Docker Swarm clusters with Ansible.
It's assumed that Docker will be installed on each of the hosts to be included in the cluster.
install_type
is the most important variable in this cookbook as it will decide the role the host will play in the Swarm . The options here are first_manager
, manager
or worker
.
- name: Set first swarm manager
hosts: swarm-first-manager
become: true
roles:
- {role: swarm, install_type: first_manager}
- name: Add managers
hosts: swarm-manager
become: true
roles:
- {role: swarm, install_type: manager}
- name: Add workers
hosts: swarm-worker
become: true
roles:
- {role: swarm, install_type: worker}
Dependencies:
- Vagrant
- Virtualbox
- Ruby
This project uses Test Kitchen to create, provision and test the role using Inspec. With the dependencies installed you can run the tests with:
make install
- download all test dependenciesmake test
- test (destroy, create, converge, setup, verify and destroy) one or more instances
- Sion Williams (sion.williams@ext.ons.gov.uk)