From 2eba7055d2adac2f9639bc20e4a475279e738d95 Mon Sep 17 00:00:00 2001 From: Olivier Navas Date: Sat, 13 Jan 2024 20:09:30 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20version=20traefik,=20correction=20?= =?UTF-8?q?d'un=20defaut=20d'ordre=20des=20=C3=A9tapes=20d'installation,?= =?UTF-8?q?=20ajout=20d'un=20parametre=20listen=5Fip=20pour=20traefik?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- defaults/main.yml | 1 + tasks/main.yml | 10 +++++----- templates/traefik-docker-compose.yml.j2 | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) 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: