family OK
This commit is contained in:
parent
e61ff106eb
commit
920780384d
4 changed files with 94 additions and 75 deletions
|
|
@ -15,7 +15,7 @@ A variable with possible values
|
||||||
Of course, you can also decide to copy/paste or download the tutorial files contents while following the tutorial steps.
|
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/1.1>`,
|
If you want to follow this tutorial with the help of the corresponding :tutorial:`Rougail-tutorials git repository <src/branch/1.1>`,
|
||||||
this workshop page corresponds to the tags :tutorial:`v1.1_010 <src/tag/v1.1_010>` in the repository:
|
this workshop page corresponds to the tag :tutorial:`v1.1_010 <src/tag/v1.1_010>` in the repository:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
|
|
||||||
74
docs/tutorial/domainname.rst
Normal file
74
docs/tutorial/domainname.rst
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
Variable types and parameters
|
||||||
|
==================================
|
||||||
|
|
||||||
|
.. objectives:: Objectives
|
||||||
|
|
||||||
|
FIXME
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.. type-along:: Variables can have parameters
|
||||||
|
|
||||||
|
.. questions:: Question
|
||||||
|
|
||||||
|
**question**: Does our `address` domain name variable accepts IP addresses ?
|
||||||
|
|
||||||
|
**answer**: Well it depends.
|
||||||
|
|
||||||
|
We need to specify whether our variable accepts to be filled using an IP or a domain name only.
|
||||||
|
This is where the ability to parameterize our variable comes in.
|
||||||
|
|
||||||
|
.. type-along:: let's create a variable parameter named `allow_ip`
|
||||||
|
|
||||||
|
..
|
||||||
|
---
|
||||||
|
manual:
|
||||||
|
description: Manual proxy configuration
|
||||||
|
|
||||||
|
http_proxy:
|
||||||
|
description: HTTP Proxy
|
||||||
|
|
||||||
|
address:
|
||||||
|
description: HTTP address
|
||||||
|
type: domainname
|
||||||
|
params:
|
||||||
|
allow_ip: true
|
||||||
|
|
||||||
|
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_034/firefox/10-manual.yml
|
||||||
|
:language: yaml
|
||||||
|
:caption: The `address` has a parameter set in the :file:`firefox/10-manual.yml` structure file
|
||||||
|
:name: RougailAddressParameter
|
||||||
|
:linenos:
|
||||||
|
..
|
||||||
|
---
|
||||||
|
manual:
|
||||||
|
description: Manual proxy configuration
|
||||||
|
|
||||||
|
http_proxy:
|
||||||
|
description: HTTP Proxy
|
||||||
|
|
||||||
|
address:
|
||||||
|
description: HTTP address
|
||||||
|
type: domainname
|
||||||
|
params:
|
||||||
|
allow_ip: true
|
||||||
|
|
||||||
|
We can see line 11 and 12 that the params allow the domain name `address` variable to be set
|
||||||
|
with IPs.
|
||||||
|
|
||||||
|
.. glossary::
|
||||||
|
|
||||||
|
parameter
|
||||||
|
|
||||||
|
A parameter is a property of a variable that can refine its behavior
|
||||||
|
|
||||||
|
|
||||||
|
.. keypoints:: let's review the key points
|
||||||
|
|
||||||
|
**Keywords**
|
||||||
|
|
||||||
|
- we can add :term:`parameter`\ s to variables to refine their behavior
|
||||||
|
|
||||||
|
**Progress**
|
||||||
|
|
||||||
|
FIXME
|
||||||
|
|
@ -19,7 +19,8 @@ Group variables inside families
|
||||||
Of course, you can also decide to copy/paste or download the tutorial files contents while following the tutorial steps.
|
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/1.1>`,
|
If you want to follow this tutorial with the help of the corresponding :tutorial:`Rougail-tutorials git repository <src/branch/1.1>`,
|
||||||
this workshop page corresponds to the tags :tutorial:`v1.1_020 <src/tag/v1.1_020>` in the repository: FIXME: END TAG
|
this workshop page corresponds to the tags :tutorial:`v1.1_020 <src/tag/v1.1_020>` to :tutorial:`v1.1_022 <src/tag/v1.1_022>`
|
||||||
|
in the repository.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
|
@ -246,84 +247,18 @@ Everything is OK:
|
||||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 HTTP address: example.net ◀ loaded from the YAML file "config/02/config.yml"
|
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 HTTP address: example.net ◀ loaded from the YAML file "config/02/config.yml"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
Let's recap about the user datas. We can see in this rougail CLI output that:
|
Let's recap about the user datas. We can see in this rougail CLI output that:
|
||||||
|
|
||||||
- the `proxy_mode` value is set by default by the :term:`integrator`
|
- the `proxy_mode` value is set by default by the :term:`integrator`
|
||||||
- the `address` value is has been set by an :term:`operator`
|
- the `address` value is has been set by an :term:`operator`
|
||||||
|
|
||||||
Variables can have parameters
|
.. type-along:: A second variable in the `http_proxy` family
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
.. questions:: Question
|
Now let's add a `port` variable in the `http_proxy` family:
|
||||||
|
|
||||||
**question**: Does our `address` domain name variable accepts IP addresses ?
|
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_022/config/03/config.yml
|
||||||
|
|
||||||
**answer**: Well it depends.
|
|
||||||
|
|
||||||
We need to specify whether our variable accepts to be filled using an IP or a domain name only.
|
|
||||||
This is where the ability to parameterize our variable comes in.
|
|
||||||
|
|
||||||
.. type-along:: let's create a variable parameter named `allow_ip`
|
|
||||||
|
|
||||||
..
|
|
||||||
---
|
|
||||||
manual:
|
|
||||||
description: Manual proxy configuration
|
|
||||||
|
|
||||||
http_proxy:
|
|
||||||
description: HTTP Proxy
|
|
||||||
|
|
||||||
address:
|
|
||||||
description: HTTP address
|
|
||||||
type: domainname
|
|
||||||
params:
|
|
||||||
allow_ip: true
|
|
||||||
|
|
||||||
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_034/firefox/10-manual.yml
|
|
||||||
:language: yaml
|
:language: yaml
|
||||||
:caption: The `address` has a parameter set in the :file:`firefox/10-manual.yml` structure file
|
:caption: The :file:`config/03/config.yml` user data file with the `port` number added
|
||||||
:name: RougailAddressParameter
|
|
||||||
:linenos:
|
|
||||||
..
|
|
||||||
---
|
|
||||||
manual:
|
|
||||||
description: Manual proxy configuration
|
|
||||||
|
|
||||||
http_proxy:
|
|
||||||
description: HTTP Proxy
|
|
||||||
|
|
||||||
address:
|
|
||||||
description: HTTP address
|
|
||||||
type: domainname
|
|
||||||
params:
|
|
||||||
allow_ip: true
|
|
||||||
|
|
||||||
We can see line 11 and 12 that the params allow the domain name `address` variable to be set
|
|
||||||
with IPs.
|
|
||||||
|
|
||||||
.. glossary::
|
|
||||||
|
|
||||||
parameter
|
|
||||||
|
|
||||||
A parameter is a property of a variable that can refine its behavior
|
|
||||||
|
|
||||||
.. type-along:: a second variable in the `http_proxy` family
|
|
||||||
|
|
||||||
Let's create a `port` variable in the `http_proxy` family:
|
|
||||||
|
|
||||||
.. confval:: port
|
|
||||||
:type: `port`
|
|
||||||
:default: 8080
|
|
||||||
|
|
||||||
The HTTP Port
|
|
||||||
|
|
||||||
Here is the new :file:`firefox/10-manual.yml` structure file:
|
|
||||||
|
|
||||||
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_022/firefox/10-manual.yml
|
|
||||||
:language: yaml
|
|
||||||
:caption: A rougail structure description file with a hierarchy.
|
|
||||||
:name: RogailPortVariable
|
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
@ -345,15 +280,24 @@ Here is the new :file:`firefox/10-manual.yml` structure file:
|
||||||
type: port
|
type: port
|
||||||
default: 8080
|
default: 8080
|
||||||
|
|
||||||
|
:tutorial:`Download this file from the rougail-tutorials git repository <src/tag/v1.1_022/config/03/config.yml>`
|
||||||
|
|
||||||
|
In short:
|
||||||
|
|
||||||
|
.. confval:: port
|
||||||
|
:type: `port`
|
||||||
|
:default: 8080
|
||||||
|
|
||||||
|
The HTTP Port
|
||||||
|
|
||||||
.. keypoints:: let's review the key points
|
.. keypoints:: let's review the key points
|
||||||
|
|
||||||
**Keywords**
|
**Keywords**
|
||||||
|
|
||||||
- we know how to define :term:`variable`\ s inside of a family
|
- we know how to define :term:`variable`\ s inside of a family
|
||||||
- we now know what a :term:`mandatory` variable is
|
- we now know what a :term:`mandatory` variable is and why it is necessary to assign values to the variables
|
||||||
- we kwow how to set a variable's user value (in a :term:`user data file`)
|
- we kwow how to set a variable's :term:`user value <user datas>`
|
||||||
- we have the big picture : the :term:`configuration`, which is (the structure files + the user data files)
|
- we have the big picture : the :term:`configuration`, which is (the structure files + the user data files)
|
||||||
- we can add :term:`parameter`\ s to variables to refine their behavior
|
|
||||||
|
|
||||||
**Progress**
|
**Progress**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ We'll learn in this tutorial how to set the values of the configuration options
|
||||||
preliminary
|
preliminary
|
||||||
choice
|
choice
|
||||||
family
|
family
|
||||||
|
domainname
|
||||||
disabled
|
disabled
|
||||||
boolean
|
boolean
|
||||||
dynfam
|
dynfam
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue