Skip to content

Commit

Permalink
resources: omit networks when network_mode is a container
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Sep 22, 2024
1 parent c3567b9 commit 24b2593
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/tasks/docker/create_docker_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
name: "{{ lookup('vars', _var_prefix + '_docker_container', default=_var_prefix) }}"
network_mode: "{{ lookup('vars', _var_prefix + '_docker_network_mode', default=docker_networks_name_common) }}"
networks: "{{ omit
if (lookup('vars', _var_prefix + '_docker_network_mode', default=docker_networks_name_common) == 'host')
if (lookup('vars', _var_prefix + '_docker_network_mode', default=docker_networks_name_common) == 'host') or ('container' in lookup('vars', _var_prefix + '_docker_network_mode', default=docker_networks_name_common))
else lookup('vars', _var_prefix + '_docker_networks') }}"
networks_cli_compatible: true
oom_killer: "{{ lookup('vars', _var_prefix + '_docker_oom_killer', default=omit) }}"
Expand Down

0 comments on commit 24b2593

Please sign in to comment.