[tutorial 061] A variable with multiple value (config and doc)

This commit is contained in:
egarette@silique.fr 2024-10-23 20:01:47 +02:00
parent 601c437deb
commit 91d7c18e6c
5 changed files with 45 additions and 9 deletions

View file

@ -1,9 +1,9 @@
- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
- [[tutorial 051] A conditional disabled variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_051/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_051~1..v1.1_051))
- [[tutorial 060] A variable with type "domainname", parameters type and disabled](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_060/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_060~1..v1.1_060))
# [tutorial 060] A variable with type "domainname", parameters type and disabled
# [tutorial 061] A variable with multiple value
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_060~1..v1.1_060)
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_061~1..v1.1_061)
## Screenshot
@ -128,6 +128,7 @@ no_proxy:
allow_cidr_network: true
allow_without_dot: true
allow_startswith_dot: true
multi: true
disabled:
variable: proxy_mode
when: No proxy
@ -181,7 +182,7 @@ This family builds families dynamically.
| Variable                                                                                                                                                                                  | Description                                                                                                                                                                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auto**<br/>[`web_address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` _`disabled`_ | Automatic proxy configuration URL.<br/>**Disabled**: proxy_mode. |
| **no_proxy**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` _`disabled`_ | Address for which proxy will be desactivated.<br/>**Validators**:<br/>- the domain name can starts by a dot<br/>- the domain name can be a hostname<br/>- the domain name can be an IP<br/>- the domain name can be network in CIDR format<br/>**Disabled**: proxy_mode. |
| **no_proxy**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` _`disabled`_ `unique` `multiple` | Address for which proxy will be desactivated.<br/>**Validators**:<br/>- the domain name can starts by a dot<br/>- the domain name can be a hostname<br/>- the domain name can be an IP<br/>- the domain name can be network in CIDR format<br/>**Disabled**: proxy_mode. |
## User data
@ -218,7 +219,9 @@ Variables:
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy: 192.168.1.0/24
no_proxy:
- example.net
- 192.168.1.0/24
```
#### Output
@ -235,8 +238,30 @@ foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/02/config.yaml
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 proxy_mode: Automatic proxy configuration URL (<span style="color: #00aa00">No proxy</span>)
<span style="color: #5c5cff">┣━━ </span>📓 auto: https://auto.proxy.net/wpad.dat
<span style="color: #5c5cff">┗━━ </span>📓 no_proxy: 192.168.1.0/24
<span style="color: #5c5cff">┗━━ </span>📓 no_proxy :
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>example.net
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>192.168.1.0/24
</pre>
### Example 3
#### config/03/config.yaml
```yml
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
```
#### Output
```console
foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/03/config.yaml
```
<pre>🛑 ERRORS
<span style="color: #ff0000">┣━━ </span>The following variables are mandatory but have no value:
<span style="color: #ff0000">┗━━ </span> - no_proxy (Address for which proxy will be desactivated)
</pre>
- [[tutorial 061] A variable with multiple value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_061/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_061~1..v1.1_061))
- [[tutorial 062] A non mandatory variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_062/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_062~1..v1.1_062))

View file

@ -1,4 +1,6 @@
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy: 192.168.1.0/24
no_proxy:
- example.net
- 192.168.1.0/24

View file

@ -7,5 +7,7 @@
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 proxy_mode: Automatic proxy configuration URL (<span style="color: #00aa00">No proxy</span>)
<span style="color: #5c5cff">┣━━ </span>📓 auto: https://auto.proxy.net/wpad.dat
<span style="color: #5c5cff">┗━━ </span>📓 no_proxy: 192.168.1.0/24
<span style="color: #5c5cff">┗━━ </span>📓 no_proxy :
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>example.net
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>192.168.1.0/24
</pre>

3
config/03/config.yaml Normal file
View file

@ -0,0 +1,3 @@
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat

4
config/03/output_ro.html Normal file
View file

@ -0,0 +1,4 @@
<pre>🛑 ERRORS
<span style="color: #ff0000">┣━━ </span>The following variables are mandatory but have no value:
<span style="color: #ff0000">┗━━ </span> - no_proxy (Address for which proxy will be desactivated)
</pre>