Set permanent Traefik defaults

Traefik exposes containers by default. I disable that.
This commit is contained in:
Kris Lamoureux 2019-12-07 23:24:34 -05:00
parent 61542aba88
commit efb29a2c37
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
2 changed files with 9 additions and 5 deletions

View File

@ -1,9 +1,7 @@
traefik_name: traefik
traefik_version: latest
traefik_options:
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--api=true"
- "--api.dashboard=true"
traefik_ports:
- "80:80"

View File

@ -1,4 +1,10 @@
- name: Create traefik network
- name: Set default Traefik options
set_fact:
traefik_defaults:
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- name: Create Traefik network
docker_network:
name: traefik-net
@ -6,7 +12,7 @@
docker_container:
name: "{{ traefik_name }}"
image: traefik:{{ traefik_version }}
command: "{{ traefik_options }}"
command: "{{ traefik_defaults + traefik_options }}"
state: started
restart_policy: always
ports: "{{ traefik_ports }}"