diff --git a/Ansible/asserts/proxy.yml b/Ansible/asserts/proxy.yml index d79e6d8..82a84d8 100644 --- a/Ansible/asserts/proxy.yml +++ b/Ansible/asserts/proxy.yml @@ -14,8 +14,7 @@ - name: Test variable env_proxy.no_proxy ansible.builtin.assert: that: - - env_proxy.no_proxy is defined - - env_proxy.no_proxy | type_debug == 'list' + - env_proxy.no_proxy is not defined or env_proxy.no_proxy | type_debug == 'list' fail_msg: "La variable n'existe pas ou est de mauvais type !" - name: Test variable env_proxy.no_proxy is a list of string ansible.builtin.assert: @@ -25,3 +24,4 @@ loop: "{{ env_proxy.no_proxy }}" loop_control: loop_var: no_proxy + when: env_proxy.no_proxy is defined diff --git a/Ansible/inventory/group_vars/all/proxy.yml b/Ansible/inventory/group_vars/all/proxy.yml index 4a2825b..f9cee7b 100644 --- a/Ansible/inventory/group_vars/all/proxy.yml +++ b/Ansible/inventory/group_vars/all/proxy.yml @@ -2,4 +2,4 @@ env_proxy_all: host: "{{ env_proxy.host }}" port: "{{ env_proxy.port | default(3128) }}" - no_proxy: "{{ env_proxy.no_proxy }}" + no_proxy: "{{ env_proxy.no_proxy | default([])}}" diff --git a/doc.md b/doc.md index 639cd34..8ea7611 100644 --- a/doc.md +++ b/doc.md @@ -17,18 +17,13 @@ to make network connections to network services outside its own network. |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **host**
`mandatory`
**Type:** [`domainname`](https://forge.cloud.silique.fr/stove/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | The proxy server’s address.
Specifies the hostname of proxy server to enable proxy server access to all of your HTTP(s) requests. .
**Example:** proxy.silique.fr | | **port**
`mandatory`
**Type:** [`port`](https://forge.cloud.silique.fr/stove/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | The proxy server's port.
**Default:** 3128 | -| **no_proxy**
`mandatory`, `multiple`
**Type:** [`domainname`](https://forge.cloud.silique.fr/stove/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | Exclude proxy server.
Network address(es), network address range(s) and domains to exclude from using the proxy when initiating connection(s). .
**Examples:** 192.168.1.1, 192.168.10.0/24, www.silique.fr, .internal.silique.fr | +| **no_proxy**
`multiple`
**Type:** [`domainname`](https://forge.cloud.silique.fr/stove/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | Exclude proxy server.
Network address(es), network address range(s) and domains to exclude from using the proxy when initiating connection(s). .
**Examples:** 192.168.1.1, 192.168.10.0/24, www.silique.fr, .internal.silique.fr | # Example with mandatories variables ``` env_proxy: host: proxy.silique.fr - no_proxy: - - 192.168.1.1 - - 192.168.10.0/24 - - www.silique.fr - - .internal.silique.fr ``` # Example with all variables