2023-12-17 20:25:53 +01:00
Getting started
====================
2025-02-20 11:35:55 +01:00
.. _installation:
Installation
----------------
2025-02-20 14:23:34 +01:00
You can use the python installer and type the install command in your preferred terminal:
2025-02-20 11:35:55 +01:00
.. code-block :: text
pip install rougail
a better way to install the Rougail library in to do this in a virtual environment:
.. code-block :: text
python -m"venv' .venv
And, under linux or Mac:
.. code-block :: shell
./.venv/bin/activate
or, under windows:
.. code-block :: text
.venv\Scripts\activate.exe
2023-12-17 20:25:53 +01:00
What is a consistency handling system ?
------------------------------------------------
2025-02-03 20:20:15 +01:00
.. questions :: Question
2024-10-14 19:17:44 +02:00
2025-02-20 11:35:55 +01:00
**Question** : OK, I have understood that the Rougail library enables me to take advantage of the :xref: `tiramisu` library. But what is all this for? What is exactly a consistency handling system? And again, what is this :xref: `tiramisu library` used for?
2023-12-17 20:25:53 +01:00
2025-02-03 20:20:15 +01:00
**Answer** : Well, now we explain what this :xref: `tiramisu` library is, and how we are using it.
2023-12-17 20:25:53 +01:00
.. glossary ::
Tiramisu
2024-10-14 19:17:44 +02:00
:xref: `tiramisu` is a consistency handling system that has initially been designed
2023-12-17 20:25:53 +01:00
in the configuration management scope. To put it more simply,
this library is generally used to handle configuration options.
It manages variables and group of variables. In the Tiramisu scope we call
it *options* and *option descriptions* .
2025-02-20 11:35:55 +01:00
Here is the :xref: `tiramisu documentation <tiramisu>` .
2024-10-14 19:17:44 +02:00
2023-12-17 20:25:53 +01:00
In the Rougail scope, we call it :term: `variable` \ s and :term: `families` .
2025-02-09 11:20:36 +01:00
In Rougail, the families and variables are located in the :term: `structure files <structure file>` .
2023-12-17 20:25:53 +01:00
2024-10-21 19:50:26 +02:00
The structure files
2023-12-17 20:25:53 +01:00
---------------------
.. glossary ::
2024-10-21 19:50:26 +02:00
structure file
2023-12-17 20:25:53 +01:00
2025-02-09 10:47:48 +01:00
A structure file in the Rougail meaning is a YAML file that describes variables
2023-12-17 20:25:53 +01:00
and their dependencies / consistencies.
2025-02-09 10:47:48 +01:00
There can be a lot of structure files located in many different folders.
2023-12-17 20:25:53 +01:00
Rougail reads all the dictionaries and loads them into a single object
that handles the variables consistency.
.. image :: images/schema.png
2024-01-23 10:57:01 +01:00
The main advantage is that declaring variables and writing consistency is as simple
as writing YAML. With Rougail it is not necessary to write :term: `Tiramisu` code any more.
2023-12-17 20:25:53 +01:00
It simplifies a lot of things.
2025-02-03 20:20:15 +01:00
And rather than writing :term: `Tiramisu` code, we can declare variables and describe the relationships between variables in a declarative style (that is, in a YAML file).
2023-12-17 20:25:53 +01:00
2025-02-03 20:20:15 +01:00
Once the structure files are loaded by Rougail, the Tiramisu configuration management tool can check the consistency of the variables between them.
2023-12-17 20:25:53 +01:00
The variables
-----------------
2025-02-20 11:35:55 +01:00
Here is a :term: `structure file` example with only a variable **variable** named `proxy_mode`
2024-10-15 09:20:01 +02:00
A variable can be defined with no default value at all.
2024-10-28 15:29:11 +01:00
.. extinclude :: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_011/firefox/00-proxy.yml
2024-10-15 15:50:01 +02:00
:language: yaml
2025-02-04 15:48:49 +01:00
:caption: A Rougail dictionnary file with a variable named `proxy_mode`, with a description.
2024-10-15 15:50:01 +02:00
:name: RougailDictionaryFirstVariableDescription
2024-10-28 15:29:11 +01:00
..
---
proxy_mode:
description: Configure Proxy Access to the Internet
2024-10-15 15:50:01 +02:00
2024-10-28 15:29:11 +01:00
The same with a default value:
2024-10-15 15:50:01 +02:00
2024-10-28 15:29:11 +01:00
.. extinclude :: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_012/firefox/00-proxy.yml
2024-10-15 15:50:01 +02:00
:language: yaml
2025-02-04 15:48:49 +01:00
:caption: A Rougail dictionnary file with a variable named `proxy_mode`, with a default value.
2024-10-15 15:50:01 +02:00
:name: RougailDictionaryFirstVariableDefault
2024-10-28 15:29:11 +01:00
..
---
proxy_mode:
description: Configure Proxy Access to the Internet
default: No proxy
2023-12-17 20:25:53 +01:00
variable
2025-02-03 20:20:15 +01:00
A :term: `variable` is a declaration unit that represents a business domain metaphor,
2024-01-23 10:57:01 +01:00
the most common example is that a variable that represents a configuration option
2023-12-17 20:25:53 +01:00
in a application, but a variable represents something more that a configuration option.
It provides a business domain specific representation unit.
Families of variables
--------------------------
2025-02-03 20:20:15 +01:00
family
2024-01-23 10:57:01 +01:00
2025-02-20 11:35:55 +01:00
A :term: `family` is simply a container of variables and/ore some subfamilies.
2025-02-04 15:48:49 +01:00
2025-02-20 11:35:55 +01:00
Here how a YAML structure file with a family looks like:
2025-02-04 15:48:49 +01:00
2025-02-20 11:35:55 +01:00
.. code-block :: yaml
:caption: A :file:`hello.yml` structure sample file
2025-02-04 15:48:49 +01:00
2025-02-20 11:35:55 +01:00
---
version: '1.1'
world:
description: Hello world family container
name:
description: Somebody to say hello
default: rougail
Here, we have a family named `world` .
This family contains a variable named `name`
2025-02-04 15:48:49 +01:00