update dynfam
This commit is contained in:
parent
10eee79dc2
commit
ed09bfd4ae
1 changed files with 91 additions and 43 deletions
|
|
@ -49,6 +49,8 @@ in one shot?
|
|||
The interesting point here is that they are very similar in our firefox's
|
||||
configuration and that we can do batch processing.
|
||||
|
||||
.. index:: dynamic family
|
||||
|
||||
Family: a dynamic family
|
||||
----------------------------
|
||||
|
||||
|
|
@ -216,11 +218,11 @@ Here is our dynamic familiy in situation in the :file:`firefox/20-manual.yml` st
|
|||
When we launch the Rougail CLI, we can see the concrete families
|
||||
and variables that have been created:
|
||||
|
||||
Voici le user data file sur lequel nous allons lancer la Rougail CLI:
|
||||
Here is the user data file on which we will launch the Rougail CLI:
|
||||
|
||||
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_060/config/01/config.yml
|
||||
:language: yaml
|
||||
:caption: In this :file:`config/01/config.yml` user data file, we assign values to variables that have been disabled
|
||||
:caption: The :file:`config/01/config.yml` user data file
|
||||
|
||||
..
|
||||
---
|
||||
|
|
@ -248,7 +250,7 @@ The Rougail CLI outputs this:
|
|||
:class: output
|
||||
|
||||
..
|
||||
rougail -m structfile/proxy.yml -u yaml --yaml.filename userdata/proxy.yml
|
||||
rougail -m firefox/proxy.yml -u yaml --yaml.filename config/proxy.yml
|
||||
╭─────────────────── Caption ────────────────────╮
|
||||
│ Variable Default value │
|
||||
│ Unmodifiable variable Modified value │
|
||||
|
|
@ -274,79 +276,125 @@ We can see that the dynamic families have been created:
|
|||
|
||||
and, as we expected, containing an address and a port.
|
||||
|
||||
A conditional disabled variable with dynamic identifier
|
||||
--------------------------------------------------------
|
||||
|
||||
GWEN
|
||||
.. type-along:: For those who follow the tutorial with the help of the git repository
|
||||
|
||||
.. todo:: déplacer ce hidden dans une autre page
|
||||
Now you need to checkout the `v1.1_061` version::
|
||||
|
||||
git switch --detach v1.1_061
|
||||
|
||||
.. _conditional_hidden_family:
|
||||
|
||||
A conditional hidden familiy
|
||||
--------------------------------
|
||||
|
||||
Here is the final YAML version of the HTTPS and SOCKS proxy families:
|
||||
Here is the final version of the HTTPS and SOCKS structure file:
|
||||
|
||||
We have added:
|
||||
|
||||
- a conditional hidden family property
|
||||
- a default value
|
||||
|
||||
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_037/firefox/20-manual.yml
|
||||
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_061/firefox/20-manual.yml
|
||||
:language: yaml
|
||||
:caption: firefox/20-proxy.yml
|
||||
:caption: The final :file:`firefox/20-proxy.yml` structure file
|
||||
|
||||
..
|
||||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
manual:
|
||||
|
||||
use_for_https:
|
||||
description: Also use this proxy for HTTPS
|
||||
default: true
|
||||
use_for_https: true # Also use this proxy for HTTPS
|
||||
|
||||
"{{ identifier }}_proxy":
|
||||
description: "{{ identifier }} Proxy"
|
||||
'{{ identifier }}_proxy':
|
||||
description: '{{ identifier }} Proxy'
|
||||
hidden:
|
||||
variable: _.use_for_https
|
||||
dynamic:
|
||||
- HTTPS
|
||||
- SOCKS
|
||||
hidden:
|
||||
variable: manual.use_for_https
|
||||
|
||||
address:
|
||||
description: "{{ identifier }} address"
|
||||
description: '{{ identifier }} address'
|
||||
default:
|
||||
variable: manual.http_proxy.address
|
||||
variable: __.http_proxy.address
|
||||
|
||||
port:
|
||||
description: "{{ identifier }} port"
|
||||
description: '{{ identifier }} port'
|
||||
default:
|
||||
variable: manual.http_proxy.port
|
||||
variable: __.http_proxy.port
|
||||
|
||||
version:
|
||||
description: SOCKS host version used by proxy
|
||||
choices:
|
||||
- v4
|
||||
- v5
|
||||
default: v5
|
||||
disabled:
|
||||
type: identifier
|
||||
when: HTTPS
|
||||
...
|
||||
|
||||
The conditional property is this one:
|
||||
The disabled `property` is assigned here to the `version` variable
|
||||
in the case where the identifier is HTTPS.
|
||||
|
||||
.. code-block:: yaml
|
||||
..
|
||||
version:
|
||||
description: SOCKS host version used by proxy
|
||||
choices:
|
||||
- v4
|
||||
- v5
|
||||
default: v5
|
||||
disabled:
|
||||
type: identifier
|
||||
when: HTTPS
|
||||
|
||||
hidden:
|
||||
variable: manual.use_for_https
|
||||
|
||||
it uses `use_for_https` variable:
|
||||
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_061/config/01/config.yml
|
||||
:language: yaml
|
||||
:caption: The :file:`config/01/config.yml` user data file
|
||||
|
||||
.. code-block:: yaml
|
||||
..
|
||||
---
|
||||
proxy_mode: Manual proxy configuration
|
||||
manual:
|
||||
http_proxy:
|
||||
address: http.proxy.net
|
||||
port: 3128
|
||||
use_for_https: false
|
||||
https_proxy:
|
||||
address: https.proxy.net
|
||||
|
||||
.. raw:: html
|
||||
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_061/config/01/cmd_ro.txt
|
||||
:class: terminal
|
||||
|
||||
..
|
||||
rougail -m firefox/ -u yaml -yf config/01/config.yml
|
||||
|
||||
use_for_https:
|
||||
description: Also use this proxy for HTTPS
|
||||
default: true
|
||||
The Rougail CLI outputs this:
|
||||
|
||||
.. raw:: html
|
||||
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_061/config/01/output_ro.html
|
||||
:class: output
|
||||
|
||||
..
|
||||
Variables:
|
||||
┣━━ 📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/01/config.yml" (⏳ No proxy)
|
||||
┗━━ 📂 Manual proxy configuration
|
||||
┣━━ 📂 HTTP Proxy
|
||||
┃ ┣━━ 📓 HTTP address: http.proxy.net ◀ loaded from the YAML file "config/01/config.yml"
|
||||
┃ ┗━━ 📓 HTTP Port: 3128 ◀ loaded from the YAML file "config/01/config.yml" (⏳ 8080)
|
||||
┣━━ 📓 Also use this proxy for HTTPS: false ◀ loaded from the YAML file "config/01/config.yml" (⏳ true)
|
||||
┣━━ 📂 HTTPS Proxy
|
||||
┃ ┣━━ 📓 HTTPS address: https.proxy.net ◀ loaded from the YAML file "config/01/config.yml" (⏳ http.proxy.net)
|
||||
┃ ┗━━ 📓 HTTPS port: 3128
|
||||
┗━━ 📂 SOCKS Proxy
|
||||
┣━━ 📓 SOCKS address: http.proxy.net
|
||||
┣━━ 📓 SOCKS port: 3128
|
||||
┗━━ 📓 SOCKS host version used by proxy: v5
|
||||
|
||||
.. keypoints:: Key points
|
||||
|
||||
- We now know what a dynamic family is, with its identifier.
|
||||
- we now how to create default values for a variable that is calculated
|
||||
because it retrieves the value of another variable.
|
||||
- we know how to hide conditionaly a family with the same mechanism,
|
||||
that is a calculated value. It is calculated because there is a dependancy
|
||||
over another variable.
|
||||
|
||||
We will see other types of calculation in the next section.
|
||||
- We now know how to build a dynamic family is, with setting its identifier.
|
||||
- we have a new use case for the `disabled` property.
|
||||
We know how to disable conditionaly a dynamic family.
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue