|
109 | 109 | - name: Set facts based on the input |
110 | 110 | set_fact: |
111 | 111 | algo_server_name: >- |
112 | | - {% if server_name is defined %}{% set _server = server_name %}{%- elif _algo_server_name.user_input is defined and _algo_server_name.user_input | length > 0 -%} |
113 | | - {%- set _server = _algo_server_name.user_input -%} |
114 | | - {%- else %}{% set _server = defaults['server_name'] %}{% endif -%} |
| 112 | + {%- if server_name is defined -%}{% set _server = server_name %}{%- |
| 113 | + elif _algo_server_name.user_input is defined and _algo_server_name.user_input | length > 0 -%}{%- |
| 114 | + set _server = _algo_server_name.user_input -%}{%- |
| 115 | + else -%}{% set _server = defaults['server_name'] %}{%- |
| 116 | + endif -%} |
115 | 117 | {{ _server | regex_replace('(?!\.)(\W|_)', '-') }} |
116 | 118 | algo_ondemand_cellular: >- |
117 | | - {% if ondemand_cellular is defined %}{{ ondemand_cellular | bool }}{%- elif _ondemand_cellular.user_input is defined %}{{ booleans_map[_ondemand_cellular.user_input] | default(defaults['ondemand_cellular']) }}{%- else %}{{ false }}{% endif %} |
| 119 | + {%- if ondemand_cellular is defined -%}{{ ondemand_cellular | bool }}{%- |
| 120 | + elif _ondemand_cellular.user_input is defined -%}{{ booleans_map[_ondemand_cellular.user_input] | default(defaults['ondemand_cellular']) }}{%- |
| 121 | + else -%}{{ false }}{%- |
| 122 | + endif -%} |
118 | 123 | algo_ondemand_wifi: >- |
119 | | - {% if ondemand_wifi is defined %}{{ ondemand_wifi | bool }}{%- elif _ondemand_wifi.user_input is defined %}{{ booleans_map[_ondemand_wifi.user_input] | default(defaults['ondemand_wifi']) }}{%- else %}{{ false }}{% endif %} |
| 124 | + {%- if ondemand_wifi is defined -%}{{ ondemand_wifi | bool }}{%- |
| 125 | + elif _ondemand_wifi.user_input is defined -%}{{ booleans_map[_ondemand_wifi.user_input] | default(defaults['ondemand_wifi']) }}{%- |
| 126 | + else -%}{{ false }}{%- |
| 127 | + endif -%} |
120 | 128 | algo_ondemand_wifi_exclude: >- |
121 | | - {% if ondemand_wifi_exclude is defined %}{{ ondemand_wifi_exclude | b64encode }}{%- elif _ondemand_wifi_exclude.user_input is defined and _ondemand_wifi_exclude.user_input | length > 0 -%} |
122 | | - {{ _ondemand_wifi_exclude.user_input | b64encode }}{%- else %}{{ '_null' | b64encode }}{% endif %} |
| 129 | + {%- if ondemand_wifi_exclude is defined -%}{{ ondemand_wifi_exclude | b64encode }}{%- |
| 130 | + elif _ondemand_wifi_exclude.user_input is defined and _ondemand_wifi_exclude.user_input | length > 0 -%} |
| 131 | + {{ _ondemand_wifi_exclude.user_input | b64encode }}{%- |
| 132 | + else -%}{{ '_null' | b64encode }}{%- |
| 133 | + endif -%} |
123 | 134 | algo_dns_adblocking: >- |
124 | | - {% if dns_adblocking is defined %}{{ dns_adblocking | bool }}{%- elif _dns_adblocking.user_input is defined %}{{ booleans_map[_dns_adblocking.user_input] | default(defaults['dns_adblocking']) }}{%- else %}{{ false }}{% endif %} |
| 135 | + {%- if dns_adblocking is defined -%}{{ dns_adblocking | bool }}{%- |
| 136 | + elif _dns_adblocking.user_input is defined -%}{{ booleans_map[_dns_adblocking.user_input] | default(defaults['dns_adblocking']) }}{%- |
| 137 | + else -%}{{ false }}{%- |
| 138 | + endif -%} |
125 | 139 | algo_ssh_tunneling: >- |
126 | | - {% if ssh_tunneling is defined %}{{ ssh_tunneling | bool }}{%- elif _ssh_tunneling.user_input is defined %}{{ booleans_map[_ssh_tunneling.user_input] | default(defaults['ssh_tunneling']) }}{%- else %}{{ false }}{% endif %} |
| 140 | + {%- if ssh_tunneling is defined -%}{{ ssh_tunneling | bool }}{%- |
| 141 | + elif _ssh_tunneling.user_input is defined -%}{{ booleans_map[_ssh_tunneling.user_input] | default(defaults['ssh_tunneling']) }}{%- |
| 142 | + else -%}{{ false }}{%- |
| 143 | + endif -%} |
127 | 144 | algo_store_pki: >- |
128 | | - {% if ipsec_enabled %}{%- if store_pki is defined %}{{ store_pki | bool }}{%- elif _store_pki.user_input is defined %}{{ booleans_map[_store_pki.user_input] | default(defaults['store_pki']) }}{%- else %}{{ false }}{% endif %}{% endif %} |
| 145 | + {%- if ipsec_enabled -%} |
| 146 | + {%- if store_pki is defined -%}{{ store_pki | bool }}{%- |
| 147 | + elif _store_pki.user_input is defined -%}{{ booleans_map[_store_pki.user_input] | default(defaults['store_pki']) }}{%- |
| 148 | + else -%}{{ false }}{%- |
| 149 | + endif -%} |
| 150 | + {%- endif -%} |
129 | 151 | rescue: |
130 | 152 | - include_tasks: playbooks/rescue.yml |
0 commit comments