2025-02-03 20:20:15 +01:00
The families
=============
2023-12-17 20:25:53 +01:00
Synopsis
---------
2025-02-03 20:20:15 +01:00
.. glossary ::
family
2026-03-19 16:57:13 +01:00
subfamily
2026-05-31 21:22:53 +02:00
A family (or a subfamily) is simply a collection of variables that refer to
2025-02-03 20:20:15 +01:00
the same business model category. It's just a variables container.
Think of it as a container as well as a namespace.
2023-12-17 20:25:53 +01:00
.. attention :: A family without a subfamily or subvariable will be automatically deleted.
2026-05-31 21:22:53 +02:00
Naming
---------
2025-02-03 20:20:15 +01:00
It is with its name that we will be able to interact with the family.
2023-12-17 20:25:53 +01:00
2025-02-03 20:20:15 +01:00
.. seealso ::
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
Have a look at the :ref: `family naming convention <namingconvention>`
2023-12-17 20:25:53 +01:00
Parameters
---------------
2024-03-28 09:43:33 +01:00
.. list-table ::
2023-12-17 20:25:53 +01:00
:widths: 15 45
:header-rows: 1
* - Parameter
- Comments
2024-03-28 09:43:33 +01:00
2026-06-01 08:55:35 +02:00
* - **description** , **_description**
2023-12-17 20:25:53 +01:00
`string`
- Description of the family.
2024-03-28 09:43:33 +01:00
2023-12-17 20:25:53 +01:00
User information to understand the usefulness of the family.
2026-06-01 12:36:47 +02:00
.. seealso :: tutorial with a real world sample :doc: `description parameter <tutorial/family>`
2026-06-01 08:55:35 +02:00
* - **help** , **_help**
2023-12-17 20:25:53 +01:00
`string`
- Additional help associated with the family.
2026-06-01 12:36:47 +02:00
.. seealso :: tutorial with a real world sample :doc: `help parameter <tutorial/examples>` (the tutorial focuses on variable, but the principle is the same for a family)
2023-12-17 20:25:53 +01:00
2026-06-01 08:55:35 +02:00
* - **mode** , **_mode**
2023-12-17 20:25:53 +01:00
`string`
- Family mode.
2026-06-01 08:55:35 +02:00
The mode is a way of classifying the importance, the level of expertise required, or the access rights to a family.
This parameter allows you to define the family mode, and also the default mode for variables or families included in this family.
2024-03-28 09:43:33 +01:00
2026-06-01 08:55:35 +02:00
.. attention :: Mode is not configured by default. You have to define mode level before use this parameter.
**Default value** : The default mode of a family is the smallest mode of the parent families, child variables, or child families that are contained in that family.
2024-03-28 09:43:33 +01:00
2026-06-01 12:36:47 +02:00
.. seealso :: tutorial with a real world sample :doc: `mode parameter <tutorial/mode>` (the tutorial focuses on variable, but the principle is the same for a family)
2023-12-17 20:25:53 +01:00
2026-06-01 08:55:35 +02:00
* - **type** , **_type**
2023-12-17 20:25:53 +01:00
`string`
2026-05-31 21:22:53 +02:00
- possible values:
- `family` (**default value** )
- `dynamic`
- `leadership`
2026-06-01 08:55:35 +02:00
* - **hidden** , **_hidden**
2026-05-31 21:22:53 +02:00
2026-06-01 08:55:35 +02:00
`boolean` or :term: `calculation`
2023-12-17 20:25:53 +01:00
- Invisible family.
2024-03-28 09:43:33 +01:00
2026-06-01 08:55:35 +02:00
Enables us to *hide* a family as well as the variables or families included in this family.
2023-12-17 20:25:53 +01:00
This means that the family will no longer be visible in `read-write` mode, but only for calculations or in `read-only` mode.
2026-06-01 08:55:35 +02:00
**Default value** : `false`
2026-05-31 21:22:53 +02:00
2026-06-01 12:36:47 +02:00
.. seealso :: tutorial with a real world sample :doc: `hidden parameter <tutorial/properties>`
2023-12-17 20:25:53 +01:00
2026-06-01 08:55:35 +02:00
* - **disabled** , **_disabled**
2023-12-17 20:25:53 +01:00
2026-06-01 08:55:35 +02:00
`boolean` or :term: `calculation`
2023-12-17 20:25:53 +01:00
- Disabled family.
2024-03-28 09:43:33 +01:00
2026-06-01 08:55:35 +02:00
Allows us to *deactivate* a family as well as the variables or families included in this family.
2024-03-28 09:43:33 +01:00
2023-12-17 20:25:53 +01:00
This means that the family will no longer be visible to the user but also to a :term: `calculation` .
2026-06-01 08:55:35 +02:00
**Default value** : `false`
2023-12-17 20:25:53 +01:00
2026-06-01 12:36:47 +02:00
.. seealso :: tutorial with a real world sample :doc: `disabled parameter <tutorial/properties>`
2023-12-17 20:25:53 +01:00
2026-06-01 08:55:35 +02:00
* - **dynamic** , **_dynamic**
2023-12-17 20:25:53 +01:00
2026-06-01 08:55:35 +02:00
:term: `calculation` or a list of :term: `calculation` or `string`
2026-05-31 21:22:53 +02:00
- Dynamic identifiers.
2023-12-17 20:25:53 +01:00
2026-06-01 08:55:35 +02:00
.. important :: This parameter is only available for dynamically built family. See the explanations about this below.
* - **redefine**
`boolean`
- It is possible to define a family in one :term: `structure file` and change its behavior in a second :term: `structure file` . In this case you must explicitly redefine the family.
**Default value** : `false`
* - **exists**
`boolean`
- This parameter does two things:
- creates a family if it does not exist in another :term: `structure file` (otherwise do nothing), in this case the value of the parameter must be `true`
- in conjunction with the `redefine` parameter set to `true` , only modifies the behavior if it is pre-existing, in which case the parameter's value must be `false` .
**Default value** : `null`
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
.. note ::
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
If a subfamily or a subvariable already has the name of a parameter it is possible to use the "_<parameter>" name.
2026-06-01 12:36:47 +02:00
You can have a look at the tutorial with a real world sample :doc: `of parameter with "_" <tutorial/underscore_parameter>` .
2023-12-17 20:25:53 +01:00
2026-06-01 19:47:26 +02:00
Shorthand declaration
----------------------------
Shorthand declaration is a way to declare a family in a single line.
To create a family, just add a key with it's name and variables as values:
.. code-block :: yaml
%YAML 1.2
---
version: 1.1
my_family:
my_variable:
...
By default, the description of the family is the family name.
It's a best practice to description a family. Just add comment in same line of name, this comment is use as description:
.. code-block :: yaml
%YAML 1.2
---
version: 1.1
my_family: # This is a great family
my_variable:
...
But in shorthand notation, you can only define family name and description.
.. attention :: Any other parameters will be considered as a variable. Do not use shorthand in this case.
2026-05-31 21:22:53 +02:00
A family
---------
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
Here is a simple example:
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
.. code-block :: yaml
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
%YAML 1.2
---
version: 1.1
my_family:
description: This is a great family
help: This family is great because we have great variables inside
2023-12-17 20:25:53 +01:00
2026-06-01 19:47:26 +02:00
my_variable:
2026-05-31 21:22:53 +02:00
...
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
.. seealso ::
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
You can have a look at the tutorial with a real world sample:
2023-12-17 20:25:53 +01:00
2026-06-01 12:36:47 +02:00
- :doc: `family <tutorial/family>`
- :doc: `help parameter <tutorial/examples>` (the tutorial focuses on variable, but the principle is the same for a family)
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
A dynamically built family
-----------------------------
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
To create a family dynamically, you must create a fictitious family linked to a list of uniq identifiers.
This list could be hard coded or resulting from a calculation
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
In this case if the result of calculation were to evolve, new dynamic families will appear or disappear.
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
The name of this family is particular. You have to add `{{ identifier }}` string inside. It will be replace by each identifiers.
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
Here is an simple example:
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
.. code-block :: yaml
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
%YAML 1.2
---
version: 1.1
my_{{ identifier }}_family:
description: 'A family for {{ identifier }}'
dynamic:
- one thing
- another
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
variable:
description: 'A variable for {{ identifier }}'
...
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
This will dynamically create two families:
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
- "my_one_thing_family"
- "my_another_family"
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
.. seealso ::
2023-12-17 20:25:53 +01:00
2026-06-01 12:36:47 +02:00
You can have a look at the tutorial with a real world sample :doc: `dynamically built family <tutorial/dynfam>`
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
Similar object sequence
-------------------------
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
A family with `type` set to `leadership` is a sequence of similar object.
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
Let's start the explanation with a concrete example:
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
.. code-block :: yaml
2024-03-28 09:43:33 +01:00
2026-05-31 21:22:53 +02:00
%YAML 1.2
---
version: 1.1
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
accounts:
description: All accounts
type: leadership
2024-03-28 09:43:33 +01:00
2026-05-31 21:22:53 +02:00
login:
description: Account login
type: unix_user
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
secret:
description: Account secret
type: secret
...
2024-03-28 09:43:33 +01:00
2026-05-31 21:22:53 +02:00
What is expected, it's something like:
2024-03-28 09:43:33 +01:00
2026-05-31 21:22:53 +02:00
.. code-block :: yaml
2024-03-28 09:43:33 +01:00
2026-05-31 21:22:53 +02:00
---
accounts:
- login: foo
secret: 0hM%G0dW4a7ASecr3t
- login: bar
secret: NotGoodSecret
2024-03-28 09:43:33 +01:00
2026-05-31 21:22:53 +02:00
It's what we call a sequence of similar object.
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
.. attention :: A sequence cannot contain other families.
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
.. seealso ::
2023-12-17 20:25:53 +01:00
2026-06-01 12:36:47 +02:00
You can have a look at the tutorial with a real world sample :doc: `similar object sequence <tutorial/sequence>`
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
A custom type family
----------------------
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
In short, a custom type is nothing more than a kind of a template for a family.
Define a custom type family is much like defining families.
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
This custom type family can be used as many times as desired and customized as you wish.
2023-12-17 20:25:53 +01:00
2026-05-31 21:22:53 +02:00
.. seealso ::
2023-12-17 20:25:53 +01:00
2026-06-01 12:36:47 +02:00
You can have a look at the tutorial with a real world sample :doc: `family custom type <tutorial/family>`