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_name: traefik
|
||||||
traefik_version: latest
|
traefik_version: latest
|
||||||
traefik_options:
|
traefik_options:
|
||||||
- "--providers.docker"
|
|
||||||
- "--providers.docker.exposedbydefault=false"
|
|
||||||
- "--entrypoints.web.address=:80"
|
- "--entrypoints.web.address=:80"
|
||||||
- "--api=true"
|
- "--api.dashboard=true"
|
||||||
traefik_ports:
|
traefik_ports:
|
||||||
- "80:80"
|
- "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:
|
docker_network:
|
||||||
name: traefik-net
|
name: traefik-net
|
||||||
|
|
||||||
@ -6,7 +12,7 @@
|
|||||||
docker_container:
|
docker_container:
|
||||||
name: "{{ traefik_name }}"
|
name: "{{ traefik_name }}"
|
||||||
image: traefik:{{ traefik_version }}
|
image: traefik:{{ traefik_version }}
|
||||||
command: "{{ traefik_options }}"
|
command: "{{ traefik_defaults + traefik_options }}"
|
||||||
state: started
|
state: started
|
||||||
restart_policy: always
|
restart_policy: always
|
||||||
ports: "{{ traefik_ports }}"
|
ports: "{{ traefik_ports }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user