Get rid of json_query

This commit is contained in:
Wojciech Kozlowski 2022-12-18 02:53:05 +01:00
parent ab6b33f4af
commit 8b083f5939

View File

@ -19,9 +19,12 @@ vpn_bridge_prefix: "10.66.{{ vpn_subnet_id }}"
vpn_bridge_address: "{{ vpn_bridge_prefix }}.1" vpn_bridge_address: "{{ vpn_bridge_prefix }}.1"
vpn_bridge_broadcast: "{{ vpn_bridge_prefix }}.255" vpn_bridge_broadcast: "{{ vpn_bridge_prefix }}.255"
vpn_bridge_netmask: "255.255.255.0" vpn_bridge_netmask: "255.255.255.0"
vpn_bridge_dnat: "{{ services_host_services | dict2items | vpn_bridge_dnat: "\
community.general.json_query('[?@.value.tcp]. {% set vpn_bridge_dnat = [] %}\
{address: value.address, ports: value.tcp}') }}" {% for properties in ( services_host_services.values() | selectattr('tcp', 'defined') ) %}\
{{ vpn_bridge_dnat.append({ 'address': properties.address, 'ports': properties.tcp }) }}\
{% endfor %}\
{{ vpn_bridge_dnat }}"
# -------------------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------------------
# services # services