container: reset variables in role init, define more defaults outside tasks

This commit is contained in:
uumas
2023-02-03 05:01:42 +02:00
parent a58c5bd47b
commit 4c6363cab0
4 changed files with 13 additions and 7 deletions

View File

@@ -57,8 +57,8 @@
image: "{{ docker_built_image.image.Id if dockerfile is defined and not ansible_check_mode else docker_image }}"
user: "{{ docker_user | default(omit) }}"
pull: "{{ dockerfile is not defined }}"
volumes: "{{ docker_volume_definition | default(omit) }}"
published_ports: "{{ container_published_ports | default([]) + docker_published_ports | default(omit) }}"
volumes: "{{ docker_volume_definition }}"
published_ports: "{{ container_published_ports + docker_published_ports }}"
labels: "{{ traefik_labels | default(omit) }}"
env: "{{ docker_env | combine(docker_additional_env) }}"
entrypoint: "{{ docker_entrypoint | default(omit) }}"