docs(split-10X-and-11X): split the web_address type from the multi, following the tuto repo order

This commit is contained in:
gwen 2026-05-29 17:38:02 +02:00
parent 28d2200915
commit a7af31bb50
2 changed files with 90 additions and 67 deletions

View file

@ -3,7 +3,7 @@ Variable with multiple values
.. objectives:: Objectives
After creating another variable for the needs of our use case, we will introduce the concept of multiple type variable.
We will introduce the concept of multiple type variable.
It is more or less some kind of a container of variable's values.
.. prerequisites:: Prerequisites
@ -24,75 +24,9 @@ Variable with multiple values
git clone https://forge.cloud.silique.fr/stove/rougail-tutorials.git
git switch --detach v1.1_110
.. type-along:: A web_address variable
A conditional disabled variable with type web_address
-------------------------------------------------------------
First we need to add a variable as part of our use case with a type we haven't used yet, the `web_address` type.
It is related to the automatic proxy configuration :term:`situation <configuration>`.
Let's put it in the new :file:`firefox/30-auto.yml` :term:`structure file`.
Note that this variable has a :term:`disabled` property defined:
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_110/firefox/30-auto.yml
:language: yaml
:caption: The :file:`firefox/30-auto.yml` structure definition file with the `auto` variable
..
%YAML 1.2
---
version: 1.1
auto:
description: Automatic proxy configuration URL
type: web_address
disabled:
variable: _.proxy_mode
when_not: Automatic proxy configuration URL
...
If the `proxy_mode` variable has the `"Automatic proxy configuration URL"` value, the `auto` variable is enabled.
It is :term:`disabled` otherwise.
Let's launch the Rougail CLI on this :term:`user data file <user data>`:
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_110/config/02/config.yml
:language: yaml
:caption: The :file:`config/02/config.yml` user data file
..
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy: 192.168.1.0/24
we have this output:
.. raw:: html
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_110/config/02/output_ro.html
:class: output
..
╭────────────── Caption ───────────────╮
│ Variable Modified value │
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
┣━━ 📓 Configure Proxy Access to the Internet: Automatic proxy configuration URL ◀ loaded from the YAML file "config/03/config.yml" (⏳ No proxy)
┗━━ 📓 Automatic proxy configuration URL: https://auto.proxy.net/wpad.dat ◀ loaded from the YAML file "config/03/config.yml"
We can see that the `auto` variable has been activated here in this :term:`situation <configuration>`.
A conditional disabled non mandatory variable with type domainname and parameters
--------------------------------------------------------------------------------------
.. type-along:: For those who follow the tutorial with the help of the git repository
Now you need to checkout the :tutorial:`v1.1_110 <src/tag/v1.1_110/README.md>` version::
git switch --detach v1.1_110
In order to fit with our use case, we need a variable that takes as its value the domain names that are allowed to pass through the proxy, if it is enabled. We already used before in this tutorial the `domainname` type, which perfectly matches our needs here.
We will just need to add certain parameters associated to this `domainname` type, as we will see.
We're gonna put it in another :term:`structure file` named :file:`firefox/40-no_proxy.yml`.

View file

@ -0,0 +1,89 @@
A `web_address` variable
================================
.. objectives:: Objectives
We are going to create another variable for the needs of our use case,
a conditional disabled variable with type `web_address`.
.. prerequisites:: Prerequisites
- We assume that Rougail's library is :ref:`installed <installation>` on your computer.
- It is possible to retrieve the current state of the various Rougail files manipulated in this tutorial step
by checking out the corresponding tag of the `rougail-tutorials` git repository.
Each tag corresponds to a stage of progress in the tutorial.
Of course, you can also decide to copy/paste or download the tutorial files contents while following the tutorial steps.
If you want to follow this tutorial with the help of the corresponding :tutorial:`rougail-tutorials git repository <src/branch/v1.1>`,
this workshop page corresponds to the tag :tutorial:`v1.1_100 <src/tag/v1.1_100/README.md>`
in the repository.
::
git clone https://forge.cloud.silique.fr/stove/rougail-tutorials.git
git switch --detach v1.1_100
.. type-along:: A web_address variable
A conditional disabled variable with type web_address
-------------------------------------------------------------
First we need to add a variable as part of our use case with a type we haven't used yet, the `web_address` type.
It is related to the automatic proxy configuration :term:`situation <configuration>`.
Let's put it in the new :file:`firefox/30-auto.yml` :term:`structure file`.
Note that this variable has a :term:`disabled` property defined:
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_110/firefox/30-auto.yml
:language: yaml
:caption: The :file:`firefox/30-auto.yml` structure definition file with the `auto` variable
..
%YAML 1.2
---
version: 1.1
auto:
description: Automatic proxy configuration URL
type: web_address
disabled:
variable: _.proxy_mode
when_not: Automatic proxy configuration URL
...
If the `proxy_mode` variable has the `"Automatic proxy configuration URL"` value, the `auto` variable is enabled.
It is :term:`disabled` otherwise.
Let's launch the Rougail CLI on this :term:`user data file <user data>`:
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_110/config/02/config.yml
:language: yaml
:caption: The :file:`config/02/config.yml` user data file
..
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy: 192.168.1.0/24
we have this output:
.. raw:: html
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_110/config/02/output_ro.html
:class: output
..
╭────────────── Caption ───────────────╮
│ Variable Modified value │
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
┣━━ 📓 Configure Proxy Access to the Internet: Automatic proxy configuration URL ◀ loaded from the YAML file "config/03/config.yml" (⏳ No proxy)
┗━━ 📓 Automatic proxy configuration URL: https://auto.proxy.net/wpad.dat ◀ loaded from the YAML file "config/03/config.yml"
We can see that the `auto` variable has been activated here in this :term:`situation <configuration>`.
.. keypoints:: Key points
In this section we have just created yet another variable, the `auto` variable, with the `web_address` type.
We are now used to conditional deactivation of a variable.