Set permanent Traefik defaults
Traefik exposes containers by default. I disable that.
This commit is contained in:
parent
61542aba88
commit
efb29a2c37
@ -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"
|
||||
|
@ -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 }}"
|
||||
|
Loading…
Reference in New Issue
Block a user