deploy reverse-proxy docker traefik with ansible on docker swarm
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
files
.travis.yml
LICENSE
README.md
docker-traefik-devel.yml
docker-traefik.yml
hosts

README.md

version Build Status Twitter


Two methods to deploy reverse-proxy docker traefik with ansible on docker swarm

  1. Ansible with module docker_swarm_service for only one docker service ref

  2. Ansible 2.8 (devel version) with module docker_stack and docker-compose.yml for docker stack ref

Module docker_swarm_service

Requirements

  • Ansible 2.7
pip install ansible==2.7

Deploy traefik

  • update hosts file with your <IP_DOCKER_MANAGER> and launch the following command :
ansible-playbook docker-traefik.yml -i hosts

Module docker_stack

Requirements

  • Ansible 2.8
pip install git+git://github.com/ansible/ansible.git@devel --upgrade

Deploy traefik

  • update hosts file with your <IP_DOCKER_MANAGER> and launch the following command :
ansible-playbook docker-traefik-devel.yml -i hosts

Access to traefik dashboard

http://<IP_DOCKER_MANAGER>:8080/dashboard

Validation of traefik workflow

Try to launch this following services :

docker service create \
    --name whoami0 \
    --label traefik.port=80 \
    --network traefik-net \
    emilevauge/whoami

and check if your dashboard look like this :

Imgur

License

Apache 2.0 Licence

This project is licensed under the Apache 2.0 license - see the LICENSE file for details.

Author Information

This role was created in 15/10/2018 by PG3