Commit b1391040 authored by Pietsch, Martin's avatar Pietsch, Martin

add new subvariable form network.nat and network.devices for jails

parent 1e704e5a
......@@ -6,23 +6,23 @@
- set_fact:
container_options: >-
{% set opts = {} -%}
{% if item.service == container.name -%}
{% if item.container == container.name -%}
{% do opts.update({'ipv4': ((container_options | default({})).ipv4 | default([])) + [item.ipv4]}) if item.ipv4 is defined and not (item.ipv4 in ((container_options | default({})).ipv4 | default([]))) -%}
{% do opts.update({'ipv6': ((container_options | default({})).ipv6 | default([])) + [item.ipv6]}) if item.ipv6 is defined and not (item.ipv6 in ((container_options | default({})).ipv6 | default([]))) -%}
{% endif -%}
{{ (container_options | default({})) | combine(opts) }}
when: item.service is defined
when: item.container is defined
with_items: "{{ network.nat | default([]) }}"
- set_fact:
container_options: >-
{% set opts = {} -%}
{% if item.value.service == container.name -%}
{% do opts.update({'ipv4': ((container_options | default({})).ipv4 | default([])) + [item.value.ipv4]}) if item.value.ipv4 is defined and not (item.ipv4 in ((container_options | default({})).ipv4 | default([]))) -%}
{% do opts.update({'ipv6': ((container_options | default({})).ipv6 | default([])) + [item.value.ipv6]}) if item.value.ipv6 is defined and not (item.ipv6 in ((container_options | default({})).ipv6 | default([]))) -%}
{% if item.value.container == container.name -%}
{% do opts.update({'ipv4': ((container_options | default({})).ipv4 | default([])) + [item.value.ipv4]}) if item.value.ipv4 is defined and not (item.value.ipv4 in ((container_options | default({})).ipv4 | default([]))) -%}
{% do opts.update({'ipv6': ((container_options | default({})).ipv6 | default([])) + [item.value.ipv6]}) if item.value.ipv6 is defined and not (item.value.ipv6 in ((container_options | default({})).ipv6 | default([]))) -%}
{% endif -%}
{{ (container_options | default({})) | combine(opts) }}
when: item.value.service is defined
when: item.value.container is defined
with_dict: "{{ network.devices | default({}) }}"
- set_fact:
......
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