Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Respect devture_systemd_docker_base_container_networks_driver_options
Browse files Browse the repository at this point in the history
  • Loading branch information
spantaleev committed Sep 18, 2024
1 parent 863aece commit f3238e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@
when: devture_systemd_docker_base_container_network_creation_method == 'ansible-module' and devture_traefik_container_network != 'host'
community.docker.docker_network:
name: "{{ devture_traefik_container_network }}"
driver: bridge
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"

- name: Ensure Traefik container network exists via command
when: devture_systemd_docker_base_container_network_creation_method == 'command' and devture_traefik_container_network != 'host'
ansible.builtin.command:
cmd: "{{ devture_systemd_docker_base_host_command_docker }} network create {{ devture_traefik_container_network }}"
cmd: "{{ devture_systemd_docker_base_host_command_docker }} network create {% for k, v in devture_systemd_docker_base_container_networks_driver_options %} --opt {{ k }}={{ v }}{% endfor %} {{ devture_traefik_container_network }}"
register: network_creation_result
failed_when: network_creation_result.rc != 0 and 'already exists' not in network_creation_result.stderr

Expand Down

0 comments on commit f3238e6

Please sign in to comment.