diff --git a/defaults/main.yml b/defaults/main.yml index 953da9c..ec2a304 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,3 +2,4 @@ docker_host_data_dir: /data1/docker docker_host_traefik_enabled: true docker_host_traefik_trusted_ips: [] docker_host_user_namespaces: true +docker_host_traefik_listen_ip: "0.0.0.0" diff --git a/tasks/main.yml b/tasks/main.yml index 8422bdb..8cc1768 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -53,11 +53,6 @@ tags: configure meta: flush_handlers -- name: configure - REBOOT IMMEDIAT pour prise en compte namespaces, relancer le playbook s'il ne poursuit pas tout seul - tags: configure - reboot: - when: grub_config.changed - - name: configure - sysctl user_namespaces tags: configure sysctl: name=user.max_user_namespaces value=15076 sysctl_set=yes state=present reload=yes @@ -70,6 +65,11 @@ notify: - restart docker +- name: configure - REBOOT IMMEDIAT pour prise en compte configuration, relancer le playbook s'il ne poursuit pas tout seul + tags: configure + reboot: + when: grub_config.changed + - name: configure - active docker tags: configure service: diff --git a/templates/traefik-docker-compose.yml.j2 b/templates/traefik-docker-compose.yml.j2 index 1bfe3bb..b3587aa 100644 --- a/templates/traefik-docker-compose.yml.j2 +++ b/templates/traefik-docker-compose.yml.j2 @@ -8,7 +8,7 @@ networks: services: traefik: - image: traefik:rocamadour + image: traefik:v2.11 restart: always command: - "--log.level=INFO" @@ -34,9 +34,9 @@ services: - "traefik.http.routers.api.tls" - "traefik.http.middlewares.auth.basicauth.users={{ docker_host_traefik_admin }}" ports: - - "0.0.0.0:80:80" - - "0.0.0.0:443:443" - - "0.0.0.0:8443:8443" + - "{{ docker_host_traefik_listen_ip }}:80:80" + - "{{ docker_host_traefik_listen_ip }}:443:443" + - "{{ docker_host_traefik_listen_ip }}:8443:8443" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro environment: