diff --git a/roles/traefik/README.md b/roles/traefik/README.md index 896ba37..e215211 100644 --- a/roles/traefik/README.md +++ b/roles/traefik/README.md @@ -17,6 +17,10 @@ Role Variables **Note: Lines that are commented out via `#` are usually still valid/used variables, but they are not defined by default, so they might enable a feature, when uncommenting/defining them!** +### Global variables, that are used: + +- `docker_package`: Defined by the docker role, this is the package name of docker within your package manager. + Dependencies ------------ diff --git a/roles/traefik/tasks/main.yml b/roles/traefik/tasks/main.yml index e374093..882eceb 100644 --- a/roles/traefik/tasks/main.yml +++ b/roles/traefik/tasks/main.yml @@ -81,6 +81,11 @@ - traefik_ipv6 is defined - traefik_ipv6.enabled +- name: Gather the package facts + package_facts: + manager: auto + +# This step is only needed in docker < 20.10, as docker does this by default now - name: Trust our proxy network ansible.posix.firewalld: zone: trusted @@ -91,6 +96,9 @@ become: true tags: - firewall + when: + - docker_package in ansible_facts.packages + - ansible_facts.packages[docker_package][0].version is version('20.10', '<') - name: Deploy dynamic_conf.yml template: