Commit 00d03cae authored by Pietsch, Martin's avatar Pietsch, Martin

bugfix: replace _natif variable with _netdev

parent 4e2b9298
......@@ -21,12 +21,12 @@
set_fact:
_container_options: >-
{% set opts = {} -%}
{% if _natif.value.container == container.name -%}
{% do opts.update({'ipv4': ((_container_options | default({})).ipv4 | default([])) + [_natif.value.ipv4]}) if _natif.value.ipv4 is defined and not (_natif.value.ipv4 in ((_container_options | default({})).ipv4 | default([]))) -%}
{% do opts.update({'ipv6': ((_container_options | default({})).ipv6 | default([])) + [_natif.value.ipv6]}) if _natif.value.ipv6 is defined and not (_natif.value.ipv6 in ((_container_options | default({})).ipv6 | default([]))) -%}
{% if _netdev.value.container == container.name -%}
{% do opts.update({'ipv4': ((_container_options | default({})).ipv4 | default([])) + [_netdev.value.ipv4]}) if _netdev.value.ipv4 is defined and not (_netdev.value.ipv4 in ((_container_options | default({})).ipv4 | default([]))) -%}
{% do opts.update({'ipv6': ((_container_options | default({})).ipv6 | default([])) + [_netdev.value.ipv6]}) if _netdev.value.ipv6 is defined and not (_netdev.value.ipv6 in ((_container_options | default({})).ipv6 | default([]))) -%}
{% endif -%}
{{ (_container_options | default({})) | combine(opts) }}
when: _natif.value.container is defined
when: _netdev.value.container is defined
loop: "{{ network.devices | default({}) | dict2items }}"
loop_control:
loop_var: _netdev
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment