fgierlinger.docker_swarm
Ansible Role: Docker Swarm
This Ansible role sets up a Docker Swarm.
Requirements
- You need to have
docker
installed on all hosts. - You also need
python-docker
installed on all hosts. - If you're using Debian 10 or Ubuntu 18.04, you need
python-six
.
You can meet these requirements by following this example:
- hosts: all
roles:
- role: geerlingguy.docker
- role: geerlingguy.pip
vars:
pip_install_packages:
- name: docker
Role Variables
Here are the variables you can use, along with their default values:
docker_swarm_network_interface: eth0
docker_swarm_port: 2377
You need a main node to create the cluster, called the primary master. You can set its name using the docker_swarm_primary_master_name
variable. The name should match the Ansible inventory node name. By default, the first host listed in your playbook will be used as the primary master.
Usage
Include this role in your playbook to make all the specified hosts part of the Docker Swarm cluster. The first host in your inventory will be the one used to connect the other hosts.
Example Playbook
- hosts: all
roles:
- role: fgierlinger.docker_swarm
License
MIT
Author Information
Frédéric Gierlinger
Installa
ansible-galaxy install fgierlinger.docker_swarm
Licenza
mit
Download
454
Proprietario