Created
June 24, 2018 14:43
-
-
Save killua-eu/f81af4a84e9cc1394d028a9b193380e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- set_fact: | |
args: | |
c_name: "{{ outer_item.name }}" | |
tmp_proxy: "{{ outer_item.proxy | default([]) }}" | |
tmp_devices: "{{ outer_item.devices | default([]) }}" | |
- name: Populate proxy_devices | |
set_fact: | |
proxy_devices: "{{ proxy_devices|default({}) | combine( {item.name: { 'listen': item.proto + ':192.168.88.102:' + item.dst|string, 'connect': item.proto + ':127.0.0.1:' + item.nxt|string, 'bind': 'host', 'type': 'proxy' } }, recursive=True ) }}" | |
with_items: "{{ tmp_proxy }}" | |
- name: Merge | |
set_fact: | |
devices: "{{ tmp_devices | combine (proxy_devices) }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment