- Edit the hosts in the hosts.ini file as well as the authentication type. Swarm manager nodes should be placed under 'docker_swarm_manager' and swarm worker nodes should be placed under 'docker_swarm_mworker'.
- Edit the 'swarm_iface' default variable in the docker role to match the primary iface used to communicate with nodes.
- Check all hosts are accessible:
ansible all -m ping -i production/hosts.ini
- Run the playbook:
ansible-playbook -i production/hosts.ini site.yml
- Open protocols and ports between the hosts The following ports must be available. On some systems, these ports are open by default.
- TCP port 2377 for cluster management communications
- TCP and UDP port 7946 for communication among nodes
- UDP port 4789 for overlay network traffic
- http://derpturkey.com/elasticsearch-cluster-with-docker-engine-swarm-mode/
- https://github.com/nextrevision/ansible-swarm-playbook/blob/master/swarm.yml