rougail/docs/concepts.rst

380 lines
9.6 KiB
ReStructuredText
Raw Normal View History

2025-11-06 11:46:31 +01:00
Abstract presentation
=========================
2026-06-04 08:27:11 +02:00
Rougail, a powerful, free/open-source configuration manager and language that combines declaration, data validation, and templating in a single, declarative syntax.
It will be useful to:
- define variables (the structure) easily and their constraintes
- loads those variables
- generate variables documentation
- loads variables' values
- validate the variables and the overall consistency handling system
- generate custom table views
- export to different common format (YAML, Ansible, ...)
- ...
2026-06-03 22:41:08 +02:00
Why another configuration manager?
2025-11-06 11:46:31 +01:00
-------------------------------------
2026-06-03 22:41:08 +02:00
Using Rougail tansform end user consumer defined consistency rules into highly consistent business objects.
It's a configuration language designed to simplify and unify the way you define, validate, and generate configuration data.
In other word, making it easier to manage complex configurations across multiple environments.
Rougail is:
- a commandline
- a `Python <https://www.python.org/>`_ library
- a description language
What kind of configuration manager?
---------------------------------------------
2025-11-06 11:46:31 +01:00
2026-06-03 22:41:08 +02:00
At the time of the design of Rougail, there were structuring choices that defined the functioning of the tool.
2025-11-06 11:46:31 +01:00
2026-06-03 22:41:08 +02:00
The steps in Rougail can be explain as follows:
2025-11-06 11:46:31 +01:00
2026-06-04 08:27:11 +02:00
- loads the variable structured data
2026-06-03 22:41:08 +02:00
- loads the user data
2026-06-04 08:27:11 +02:00
- reads, validates, exports, document, ... the data
2025-11-06 11:46:31 +01:00
2026-06-04 08:27:11 +02:00
Structured data
~~~~~~~~~~~~~~~~~
Structured data is also called Rougail format.
2025-11-06 11:46:31 +01:00
2026-06-03 22:41:08 +02:00
.. glossary::
2026-06-04 08:27:11 +02:00
structured data
A configuration-first DSL (domain-specific language) designed for describing variables, consistency
and describe the relationships between variables in a declarative style.
The language is a mix of YAML ans Jinja Templating.
2025-11-06 11:46:31 +01:00
2026-06-04 08:27:11 +02:00
It goes beyond traditional schema languages (like JSON Schema, OpenAPI, Cuelang)
by combinig type systems, powerful validation, consistency of the configuration and documentation.
2025-11-06 11:46:31 +01:00
2026-06-04 08:27:11 +02:00
Structured data are commonly place in structure file.
2025-11-06 11:46:31 +01:00
2026-06-03 22:41:08 +02:00
User data
2026-06-04 08:27:11 +02:00
~~~~~~~~~~
2025-11-06 11:46:31 +01:00
.. glossary::
2026-06-03 22:41:08 +02:00
user data
2026-06-04 08:27:11 +02:00
User datas, as opposed to structured data, are datas that only concern the assignment of values
2026-06-03 22:41:08 +02:00
and not the consistency of the variables between them.
The variable's values are also called **user values**.
2026-06-04 08:27:11 +02:00
2026-06-03 22:41:08 +02:00
The consistency field is outside of the user data scope.
The consistency is handled in the :term:`structured datas <structured data>`\ 's scope.
Here a some user data examples:
- configuration files
- environment variables
- external sources
- command-line options
- a form
Output
~~~~~~~
2026-06-04 08:27:11 +02:00
Structured and user data form a coherent configuration useful for different purpose.
Output is here to define what kind of data we want.
2026-06-03 22:41:08 +02:00
And some output examples:
2026-06-04 08:27:11 +02:00
- term:`Tiramisu` object
- extract JSON
- extract to Ansible inventory
- documentation
- custom table views
2026-06-03 22:41:08 +02:00
.. list-table::
:widths: 15 45
:header-rows: 1
* - Step
2026-06-04 08:27:11 +02:00
* - Structured data
2026-06-03 22:41:08 +02:00
* - User data
* - Output
What kind of actor?
---------------------
It's clear that Rougail can be used in many contexts.
2026-06-04 08:27:11 +02:00
Here we'll define actor names. Obviously, these aren't the only possible actors.
2026-06-03 22:41:08 +02:00
2026-06-04 08:27:11 +02:00
We're just defining the actors within the Rougail context. Choice your own actor name if you wish to personnalize in your specific context.
2026-06-03 22:41:08 +02:00
.. glossary::
integrator
An integrator in the Rougail field is the person who writes the :term:`structure files <structure file>`\ .
He has the responsibility of the integration process, that is,
he defines the variables and the relationship between them, the variables that are allowed
(or not) to be set, and so on. His responsabilites are the **structuration** and the **consistency**
of the organisation of the variables between them.
.. glossary::
operator
An operator in the Rougail field is the person who assigns :term:`value`\ s to the pre-defined variables,
his responsabilities are to set variable values correctly.
The user :term:`value`\ s, that is the values that have been set by the operator, are of course type validated.
The type validation is driven by the definitions in the :term:`structure file <structure file>`.
2026-06-04 08:27:11 +02:00
.. list-table::
:widths: 15 45
:header-rows: 1
* - Step
- Actor
- Description
* - Structured data
- Integrator
- The actor who defines the structure
* - User data
- Operator
- The actor who sets the values
* - Output
- Operator or integrator
- The actor who uses the variables with their values
2026-06-03 22:41:08 +02:00
Variable lifetime
----------------------
2026-06-04 08:27:11 +02:00
Rougail's is a configuration language and data validation tool designed to simplify defining, validating, and generating structured configuration and data.
2026-06-03 22:41:08 +02:00
Rougail aims to define variables.
Here we are talking about the variable lifetime.
The variables lifetime is the period between its creation and its destruction.
The lifecycle of a variable includes the generic stages (like, in the Python language):
.. list-table::
:widths: 15 45
:header-rows: 1
* - Creation
- Assignment
- Reading
- Destruction
* - Variables are assigned a name and a type
- The variable's value is modified
- The variable's value is used
- The variable terminates upon the destruction of the object
But other concepts are included in the lifecycle:
.. list-table::
:widths: 15 45
:header-rows: 1
2026-06-04 08:27:11 +02:00
* - Permission
- Documentation
2026-06-03 22:41:08 +02:00
- Specialization
2026-06-04 08:27:11 +02:00
* - Properties describe access constraints
- Informations for variable documentation like description or help. Those informations are used to build documentation, changelog, ...
2026-06-03 22:41:08 +02:00
- Define usage, selection,...
.. list-table::
:widths: 15 45
:header-rows: 1
* - Step
- Actor
- Lifetime
2026-06-04 08:27:11 +02:00
* - Structured data
2026-06-03 22:41:08 +02:00
- Integrator
2026-06-04 08:27:11 +02:00
- Creation
2026-06-03 22:41:08 +02:00
* - User data
- Operator
2026-06-04 08:27:11 +02:00
- Assignment and permission
2026-06-03 22:41:08 +02:00
* - Output
2026-06-04 08:27:11 +02:00
- Operator or integrator
- Reading, permission, documentation and specialization
2026-06-03 22:41:08 +02:00
2026-06-04 08:27:11 +02:00
Variable mutability
---------------------
2026-06-03 22:41:08 +02:00
2026-06-04 08:27:11 +02:00
Structured data
~~~~~~~~~~~~~~~~
2026-06-03 22:41:08 +02:00
When the integrator define the structure, variable are mutable.
Even if the default behavior is to conflict when multiple declarations for the same variable.
It's possible to explicitly allow to unifying (combined) multiple variables declarations.
User data
~~~~~~~~~~
It's no more possible to modifying variable definition.
Output
~~~~~~~
2026-06-04 08:27:11 +02:00
Variable definition settings are immutable.
2026-06-03 22:41:08 +02:00
.. list-table::
:widths: 15 45
:header-rows: 1
* - Step
- Actor
- Lifetime
2026-06-04 08:27:11 +02:00
- Variable mutability
2026-06-03 22:41:08 +02:00
2026-06-04 08:27:11 +02:00
* - Structured data
2026-06-03 22:41:08 +02:00
- Integrator
- Creation + initialization
- Mutable
* - User data
- Operator
2026-06-04 08:27:11 +02:00
- Assignment and permission
2026-06-03 22:41:08 +02:00
- Immutable
* - Output
2026-06-04 08:27:11 +02:00
- Operator or integrator
- Reading, permission, documentation and specialization
2026-06-03 22:41:08 +02:00
- Immutable
2026-06-04 08:27:11 +02:00
Value access
-------------
In the `structured data` step, there is no value, strictly speaking. It's a default value.
As other parameters, the default value is explicitly mutable.
In the `user data` step, we can modify the values. That's precisely the purpose of this step.
The configuration is said to be in `read write` mode.
But at the `output` step, it is obviously no longer possible to modify the value.
The configuration is said to be in `read only` mode.
.. attention::
It is important not to confuse `value` and `calculated value`.
The result of a calculation can change over time.
In this case, the value does indeed correspond to the result of the calculation.
2026-06-03 22:41:08 +02:00
.. list-table::
:widths: 15 45
:header-rows: 1
* - Step
- Actor
- Lifetime
2026-06-04 08:27:11 +02:00
- Variable mutability
- Value
2026-06-03 22:41:08 +02:00
2026-06-04 08:27:11 +02:00
* - Structured data
2026-06-03 22:41:08 +02:00
- Integrator
- Creation + initialization
- Mutable
2026-06-04 08:27:11 +02:00
- Mutable default value
2026-06-03 22:41:08 +02:00
* - User data
- Operator
2026-06-04 08:27:11 +02:00
- Assignment and permission
2026-06-03 22:41:08 +02:00
- Immutable
- Read write
* - Output
2026-06-04 08:27:11 +02:00
- Operator or integrator
- Reading, permission, documentation and specialization
2026-06-03 22:41:08 +02:00
- Immutable
- Read only
Access control
-----------------
2025-11-06 11:46:31 +01:00
2026-06-04 08:27:11 +02:00
.. FIXME: duplicate from tutorial/properties.rst
Access control is achieved through `properties`.
.. glossary::
property
A property is a state (`disabled`, `mandatory`, `frozen`, `hidden`...)
of a family or a variable.
These properties change the usual behavior of a variable or family.
The properties can be defined permanently or according to the result of a calculation.
There is two main properties.
Hidden variable
~~~~~~~~~~~~~~~
A `hidden` variable is a variable whose value cannot be modified by the operator.
This could be an internal variable used by the integrator that is not supposed to change.
Or a variable that only makes sense in a particular context. Therefore, this variable can be hidden and then unhidden depending on the context.
Disabled variable
~~~~~~~~~~~~~~~~~
A `disabled` variable is a variable that will not be accessible to any of the actors (integrator and operator).
This property is generally used dynamically to remove access to the variable depending on the context.
2026-06-03 22:41:08 +02:00
.. list-table::
:widths: 15 45
:header-rows: 1
2025-11-06 11:46:31 +01:00
2026-06-03 22:41:08 +02:00
* - Step
- Actor
- Lifetime
2026-06-04 08:27:11 +02:00
- Variable mutability
- Value
2026-06-03 22:41:08 +02:00
- Access control
2025-11-06 11:46:31 +01:00
2026-06-04 08:27:11 +02:00
* - Structured data
2026-06-03 22:41:08 +02:00
- Integrator
- Creation + initialization
- Mutable
2026-06-04 08:27:11 +02:00
- Mutable default value
2026-06-03 22:41:08 +02:00
- N/A
2025-11-06 11:46:31 +01:00
2026-06-03 22:41:08 +02:00
* - User data
- Operator
2026-06-04 08:27:11 +02:00
- Assignment and permission
2026-06-03 22:41:08 +02:00
- Immutable
- Read write
- hidden + disabled
2025-11-06 11:46:31 +01:00
2026-06-03 22:41:08 +02:00
* - Output
2026-06-04 08:27:11 +02:00
- Operator or integrator
- Reading, permission, documentation and specialization
2026-06-03 22:41:08 +02:00
- Immutable
- Read only
- disabled + mandatory