doc(user data and output)
This commit is contained in:
parent
64d0bfa802
commit
fa2297ec88
16 changed files with 1128 additions and 19 deletions
|
|
@ -97,9 +97,13 @@ Here a some user data examples:
|
|||
Output
|
||||
~~~~~~~
|
||||
|
||||
Structured and user data form a coherent configuration useful for different purposes.
|
||||
.. glossary::
|
||||
|
||||
Output is here to define what kind of data we want.
|
||||
output
|
||||
|
||||
Structured and user data form a coherent configuration useful for different purposes.
|
||||
|
||||
Output is here to define what kind of data we want.
|
||||
|
||||
Here are some output examples:
|
||||
|
||||
|
|
@ -223,6 +227,8 @@ But other concepts are included in the lifecycle:
|
|||
- Documentation
|
||||
- Specialization
|
||||
|
||||
.. _variable_mutability:
|
||||
|
||||
Variable mutability
|
||||
---------------------
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ Rougail
|
|||
:titlesonly:
|
||||
:caption: What is it all about
|
||||
|
||||
concepts
|
||||
abstract
|
||||
vac
|
||||
|
||||
.. toctree::
|
||||
|
|
@ -59,6 +59,12 @@ Rougail
|
|||
|
||||
user_data/index
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:caption: Output
|
||||
|
||||
output/index
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:caption: The library and the tools
|
||||
|
|
|
|||
230
docs/output/ansible.rst
Normal file
230
docs/output/ansible.rst
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
Generate Ansible inventory
|
||||
==========================
|
||||
|
||||
.. note::
|
||||
|
||||
| **Path**: ansible
|
||||
| `*disabled*`
|
||||
| **Disabled**: when the variable "select for output" (step.output) is accessible and hasn't the value "ansible".
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **ansible.output**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.output
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.OUTPUT
|
||||
- Output type.
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- inventory **← (default)**
|
||||
|
||||
- doc
|
||||
|
||||
* - **ansible.host_namespace**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.host_namespace
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.HOST_NAMESPACE
|
||||
- Namespace with host values.
|
||||
|
||||
**Default**: hosts
|
||||
|
||||
Doc configuration
|
||||
-----------------
|
||||
|
||||
.. note::
|
||||
|
||||
| **Path**: ansible.doc
|
||||
| `*disabled*`
|
||||
| **Disabled**: when the variable "Output type" (ansible.output) hasn't the value "doc".
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **ansible.doc.project_name**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.doc.project_name
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.DOC.PROJECT_NAME
|
||||
- Ansible project name.
|
||||
|
||||
* - **ansible.doc.author**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.doc.author
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.DOC.AUTHOR
|
||||
- Ansible author name.
|
||||
|
||||
* - **ansible.doc.output_format**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.doc.output_format
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.DOC.OUTPUT_FORMAT
|
||||
- The output format of the generated documentation.
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- console **← (default)**
|
||||
|
||||
- asciidoc
|
||||
|
||||
- html
|
||||
|
||||
- github
|
||||
|
||||
- gitlab
|
||||
|
||||
- restructuredtext
|
||||
|
||||
- json
|
||||
|
||||
* - **ansible.doc.collection_type**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.doc.collection_type
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.DOC.COLLECTION_TYPE
|
||||
- Collection contents.
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- auto **← (default)**
|
||||
|
||||
- playbooks
|
||||
|
||||
- roles
|
||||
|
||||
Playbooks informations
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. note::
|
||||
|
||||
| This family contains lists of variable blocks.
|
||||
| **Path**: ansible.doc.playbooks
|
||||
| `*disabled*`
|
||||
| **Disabled**: if the content is a role.
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **ansible.doc.playbooks.name**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `multiple` `unique`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.doc.playbooks.name
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.DOC.PLAYBOOKS.NAME
|
||||
- Playbook name.
|
||||
|
||||
Playbooks are placed in the playbooks/ directory. By default, the description of the "type" is used as the playbook name in the generated example. It is possible to customize this description here.
|
||||
|
||||
* - **ansible.doc.playbooks.description**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.doc.playbooks.description
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.DOC.PLAYBOOKS.DESCRIPTION
|
||||
- Playbook description.
|
||||
|
||||
Inventory configuration
|
||||
-----------------------
|
||||
|
||||
.. note::
|
||||
|
||||
| **Path**: ansible.inventory
|
||||
| `*disabled*`
|
||||
| **Disabled**: when the variable "Output type" (ansible.output) hasn't the value "inventory".
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **ansible.inventory.no_namespace_in_vars**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- --ansible.inventory.no_namespace_in_vars
|
||||
|
||||
- --ansible.inventory.no-no_namespace_in_vars
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.INVENTORY.NO_NAMESPACE_IN_VARS
|
||||
- Remove namespace name in host vars.
|
||||
|
||||
**Default**: false
|
||||
|
||||
* - **ansible.inventory.export_warnings**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- --ansible.inventory.export_warnings
|
||||
|
||||
- --ansible.inventory.no-export_warnings
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.INVENTORY.EXPORT_WARNINGS
|
||||
- Displays warnings inside Ansible exportation datas.
|
||||
|
||||
**Default**: true
|
||||
87
docs/output/display.rst
Normal file
87
docs/output/display.rst
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
Display variables and values
|
||||
============================
|
||||
|
||||
.. note::
|
||||
|
||||
| Find all the variables and their values in your configuration (structural and user data). Additional informations are available, such as the default value, the location where the value is loaded, etc.
|
||||
| **Path**: display
|
||||
| `*disabled*`
|
||||
| **Disabled**: if display is not set in "select for output" (step.output).
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **display.output_format**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--display.output_format
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DISPLAY.OUTPUT_FORMAT
|
||||
- The output format for displaying variables.
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- console **← (default)**
|
||||
|
||||
- github
|
||||
|
||||
- gitlab
|
||||
|
||||
* - **display.show_secrets**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- --display.show_secrets
|
||||
|
||||
- --display.no-show_secrets
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DISPLAY.SHOW_SECRETS
|
||||
- Show secrets instead of obscuring them.
|
||||
|
||||
**Default**: false
|
||||
|
||||
Specific configuration for console output
|
||||
-----------------------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
| **Path**: display.console
|
||||
| `*disabled*`
|
||||
| **Disabled**: when the variable "The output format for displaying variables" (display.output_format) hasn't the value "console".
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **display.console.max_width**
|
||||
|
||||
`integer <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__
|
||||
|
||||
**Command line**:
|
||||
|
||||
--display.console.max_width
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DISPLAY.CONSOLE.MAX_WIDTH
|
||||
- Maximum number of characters per line.
|
||||
|
||||
Null means unlimited.
|
||||
|
||||
**Validator**: the minimum value is 50
|
||||
381
docs/output/doc.rst
Normal file
381
docs/output/doc.rst
Normal file
|
|
@ -0,0 +1,381 @@
|
|||
Generate documentation from structural files
|
||||
============================================
|
||||
|
||||
.. note::
|
||||
|
||||
| The structural files contain all the information related to the variables. This output generates the documentation for all or some of these variables.
|
||||
| **Path**: doc
|
||||
| `*disabled*`
|
||||
| **Disabled**: if "select for output" (step.output) is not doc.
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **doc.output_format**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
-do, --doc.output_format
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.OUTPUT_FORMAT
|
||||
- The output format of the generated documentation.
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- console **← (default)**
|
||||
|
||||
- asciidoc
|
||||
|
||||
- html
|
||||
|
||||
- github
|
||||
|
||||
- gitlab
|
||||
|
||||
- restructuredtext
|
||||
|
||||
- json
|
||||
|
||||
* - **doc.tabular_template**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory` `*disabled*`
|
||||
|
||||
**Command line**:
|
||||
|
||||
-dm, --doc.tabular_template
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.TABULAR_TEMPLATE
|
||||
- Generate document with this tabular model.
|
||||
|
||||
The variables are documented with a tabular view. A template selection allows you to choose the content of each column.
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- two_columns **← (default)**
|
||||
|
||||
- three_columns
|
||||
|
||||
- four_columns
|
||||
|
||||
- five_columns
|
||||
|
||||
- six_columns
|
||||
|
||||
|
||||
|
||||
**Disabled**: "the output format of the generated documentation" (doc.output_format) in json is not compatible with this variable.
|
||||
|
||||
* - **doc.contents**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `multiple` `mandatory` `*hidden*` `unique`
|
||||
|
||||
**Command line**:
|
||||
|
||||
-dc, --doc.contents
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.CONTENTS
|
||||
- Generated content.
|
||||
|
||||
You can generate three type of document. All variables ("variables"), an example file in YAML format ("example") or change log ("changelog").
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- variables **← (default)**
|
||||
|
||||
- example
|
||||
|
||||
- changelog
|
||||
|
||||
|
||||
|
||||
**Hidden**: "the output format of the generated documentation" (doc.output_format) in json is not compatible with changelog or example "generated content" (doc.contents).
|
||||
|
||||
* - **doc.title_level**
|
||||
|
||||
`integer <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
-dt, --doc.title_level
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.TITLE_LEVEL
|
||||
- Starting title level.
|
||||
|
||||
**Default**: 1
|
||||
|
||||
* - **doc.default_values**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- --doc.default_values
|
||||
|
||||
- --doc.no-default_values
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.DEFAULT_VALUES
|
||||
- Modify values to document all variables.
|
||||
|
||||
To document leadership or dynamic family variables, it is sometimes necessary to generate values, which can change the values in the configuration. Be careful if you reuse this configuration.
|
||||
|
||||
**Default**: true
|
||||
|
||||
* - **doc.true_color**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory` `*disabled*`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- --doc.true_color
|
||||
|
||||
- --doc.no-true_color
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.TRUE_COLOR
|
||||
- Display documentation in console always with true color terminal.
|
||||
|
||||
**Default**: false
|
||||
|
||||
**Disabled**: when the variable "the output format of the generated documentation" (doc.output_format) hasn't the value "console".
|
||||
|
||||
The variables in this family are documented in another file
|
||||
-----------------------------------------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
| If you separate the variables into different files, the links between the variables will break. Therefore, you must define different filenames for the files containing these variables.
|
||||
| This family contains lists of variable blocks.
|
||||
| **Path**: doc.other_root_filenames
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **doc.other_root_filenames.root_path**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `multiple` `unique`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--doc.other_root_filenames.root_path
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.OTHER_ROOT_FILENAMES.ROOT_PATH
|
||||
- This file contains child variables of the family.
|
||||
|
||||
* - **doc.other_root_filenames.root_doc_path**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__
|
||||
|
||||
**Command line**:
|
||||
|
||||
--doc.other_root_filenames.root_doc_path
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.OTHER_ROOT_FILENAMES.ROOT_DOC_PATH
|
||||
- Name of the file.
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **doc.document_a_type**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- --doc.document_a_type
|
||||
|
||||
- --doc.no-document_a_type
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.DOCUMENT_A_TYPE
|
||||
- Documentation a structural type.
|
||||
|
||||
**Default**: false
|
||||
|
||||
Variables and changelog documentation
|
||||
-------------------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
| **Path**: doc.tabulars
|
||||
| `*disabled*`
|
||||
| **Disabled**: if "the output format of the generated documentation" (doc.output_format) is json or "generated content" (doc.contents) hasn't variables or changelog.
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **doc.tabulars.without_family**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- -df, --doc.tabulars.without_family
|
||||
|
||||
- -ndf, --doc.tabulars.no-without_family
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.TABULARS.WITHOUT_FAMILY
|
||||
- Do not add families in documentation.
|
||||
|
||||
**Default**: false
|
||||
|
||||
* - **doc.tabulars.with_commandline**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.TABULARS.WITH_COMMANDLINE
|
||||
- Add command line informations in documentation.
|
||||
|
||||
**Default**: false
|
||||
|
||||
* - **doc.tabulars.with_environment**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- -de, --doc.tabulars.with_environment
|
||||
|
||||
- -nde, --doc.tabulars.no-with_environment
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.TABULARS.WITH_ENVIRONMENT
|
||||
- Add environment variable informations in documentation.
|
||||
|
||||
**Default**: false
|
||||
|
||||
* - **doc.tabulars.environment_prefix**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `*disabled*`
|
||||
|
||||
**Command line**:
|
||||
|
||||
-dv, --doc.tabulars.environment_prefix
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.TABULARS.ENVIRONMENT_PREFIX
|
||||
- Environment variables prefix name.
|
||||
|
||||
**Validator**: should only use uppercase characters
|
||||
|
||||
**Default**: ROUGAIL
|
||||
|
||||
**Disabled**: when the variable "add environment variable informations in documentation" (doc.tabulars.with_environment) has the value "false".
|
||||
|
||||
Changelog documentation
|
||||
-----------------------
|
||||
|
||||
.. note::
|
||||
|
||||
| **Path**: doc.changelog
|
||||
| `*disabled*`
|
||||
| **Disabled**: if changelog in not in "generated content" (doc.contents).
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **doc.changelog.previous_json_file**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
-dp, --doc.changelog.previous_json_file
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.CHANGELOG.PREVIOUS_JSON_FILE
|
||||
- Previous description file in JSON format.
|
||||
|
||||
To generate the changelog, you need to compare the old list of variables (in json format) with the current variables.
|
||||
|
||||
Examples configuration
|
||||
----------------------
|
||||
|
||||
.. note::
|
||||
|
||||
| **Path**: doc.examples
|
||||
| `*disabled*`
|
||||
| **Disabled**: if example is not in "generated content" (doc.contents).
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **doc.examples.comment**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- -dx, --doc.examples.comment
|
||||
|
||||
- -ndx, --doc.examples.no-comment
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.EXAMPLES.COMMENT
|
||||
- Add description of variables and families when generate examples.
|
||||
|
||||
**Default**: false
|
||||
|
||||
* - **doc.examples.comment_column**
|
||||
|
||||
`integer <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory` `*disabled*`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--doc.examples.comment_column
|
||||
|
||||
**Environment variable**: ROUGAILCLI_DOC.EXAMPLES.COMMENT_COLUMN
|
||||
- Comment in examples starts at column.
|
||||
|
||||
**Default**: 30
|
||||
|
||||
**Disabled**: when the variable "add description of variables and families when generate examples" (doc.examples.comment) has the value "false".
|
||||
29
docs/output/formatter.rst
Normal file
29
docs/output/formatter.rst
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
Reformat the structure files
|
||||
============================
|
||||
|
||||
.. note::
|
||||
|
||||
| The structure file will be formatted according to a set of rules: empty line between each variable, short-hand notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ...
|
||||
| **Path**: formatter
|
||||
| `*disabled*`
|
||||
| **Disabled**: if formatter is not set in "select for output" (step.output).
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **formatter.line_width**
|
||||
|
||||
`integer <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--formatter.line_width
|
||||
|
||||
**Environment variable**: ROUGAILCLI_FORMATTER.LINE_WIDTH
|
||||
- Maximum line size.
|
||||
|
||||
**Default**: 120
|
||||
17
docs/output/index.rst
Normal file
17
docs/output/index.rst
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Output modules
|
||||
======================
|
||||
|
||||
Rougail is a collections of modules in order to adjust functionalities to your needs.
|
||||
|
||||
:term:`Output` is one of category of subjects. The goal is to display, export or document variable and value to meet the needs of the :term:`integrator` or :term:`operator`.
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:caption: Available output
|
||||
|
||||
display
|
||||
table
|
||||
doc
|
||||
formatter
|
||||
ansible
|
||||
json
|
||||
3
docs/output/json.rst
Normal file
3
docs/output/json.rst
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Export variables and values to JSON
|
||||
===================================
|
||||
|
||||
98
docs/output/table.rst
Normal file
98
docs/output/table.rst
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
Displays the data in a table
|
||||
============================
|
||||
|
||||
.. note::
|
||||
|
||||
| The goal is not to display all the variables in the configuration, but only a selection using the labeling mechanism.
|
||||
| **Path**: table
|
||||
| `*disabled*`
|
||||
| **Disabled**: if table is not set in "select for output" (step.output).
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **table.first_column**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--table.first_column
|
||||
|
||||
**Environment variable**: ROUGAILCLI_TABLE.FIRST_COLUMN
|
||||
- Content of the first column.
|
||||
|
||||
**Validator**: Tag name must not have the same name has first column
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- description
|
||||
|
||||
- namespace
|
||||
|
||||
|
||||
|
||||
**Default**: First column is description if "Tag names" (table.columns) has only one value, otherwise it's namespace.
|
||||
|
||||
* - **table.columns**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `multiple` `mandatory` `unique`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--table.columns
|
||||
|
||||
**Environment variable**: ROUGAILCLI_TABLE.COLUMNS
|
||||
- Tag names.
|
||||
|
||||
Each tag creates a column. The content of the columns comes from the variables with the defined tags.
|
||||
|
||||
* - **table.output_format**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--table.output_format
|
||||
|
||||
**Environment variable**: ROUGAILCLI_TABLE.OUTPUT_FORMAT
|
||||
- Tag names.
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- console **← (default)**
|
||||
|
||||
- github
|
||||
|
||||
- asciidoc
|
||||
|
||||
- html
|
||||
|
||||
- rst
|
||||
|
||||
* - **table.header**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- --table.header
|
||||
|
||||
- --table.no-header
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_TABLE.HEADER
|
||||
- Add header in table.
|
||||
|
||||
**Default**: true
|
||||
|
|
@ -40,7 +40,8 @@ That is to say, the :term:`integrator` can change the type of the variable at an
|
|||
|
||||
However, the :term:`operator` who adapts the value does not have the possibility of redefining the type of the variable.
|
||||
|
||||
.. seealso:: :doc:`the variable mutability <../concepts>`
|
||||
.. seealso:: :ref:`the variable mutability <variable_mutability>`
|
||||
|
||||
|
||||
Type inference
|
||||
''''''''''''''
|
||||
|
|
@ -221,7 +222,7 @@ Properties
|
|||
|
||||
We already see the property access control.
|
||||
|
||||
Remember, we talked about :doc:`the hidden and disabled variables <../concepts>`.
|
||||
Remember, we talked about the :ref:`hidden` and :ref:`disabled` variables.
|
||||
|
||||
These properties become fully meaningful when managing overall consistency.
|
||||
|
||||
|
|
|
|||
81
docs/user_data/ansible.rst
Normal file
81
docs/user_data/ansible.rst
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
Load user data from Ansible compatible file
|
||||
===========================================
|
||||
|
||||
.. note::
|
||||
|
||||
| Ansible offers a tool (ansible-vault) for encrypting inventory files. With this user data you can open an encrypt inventory file. This is a perfect way to manage a smooth migration from Ansible inventory to Rougail. Or it could be a way to encrypt these secrets in a file with a secure format.
|
||||
| **Path**: ansible
|
||||
| `*disabled*`
|
||||
| **Disabled**: if ansible is not set in "select for user data" (step.user_data).
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **ansible.filename**
|
||||
|
||||
`UNIX filename <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `multiple` `mandatory` `*disabled*` `unique`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.filename
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.FILENAME
|
||||
- Ansible filename inventory.
|
||||
|
||||
**Validators**:
|
||||
|
||||
|
||||
|
||||
- this filename could be a relative path
|
||||
|
||||
- this file must exist
|
||||
|
||||
- 'file type allowed: "file"'
|
||||
|
||||
|
||||
|
||||
**Disabled**: if ansible is not set in "select for user data" (step.user_data).
|
||||
|
||||
* - **ansible.secret**
|
||||
|
||||
`secret <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory` `*disabled*`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.secret
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.SECRET
|
||||
- Secret to decrypt file.
|
||||
|
||||
**Disabled**: if ansible is not set in "select for user data" (step.user_data).
|
||||
|
||||
* - **ansible.file_with_secrets**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory` `*disabled*`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--ansible.file_with_secrets
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ANSIBLE.FILE_WITH_SECRETS
|
||||
- Ansible files that may contain secrets.
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- all **← (default)**
|
||||
|
||||
- first
|
||||
|
||||
- last
|
||||
|
||||
- none
|
||||
|
||||
|
||||
|
||||
**Disabled**: if ansible is not set in "select for user data" (step.user_data).
|
||||
|
|
@ -1,3 +1,56 @@
|
|||
Load user data from Bitwarden server
|
||||
Load user data secrets from Bitwarden
|
||||
=====================================
|
||||
|
||||
.. note::
|
||||
|
||||
| Load the secrets from Bitwarden (or a compatible server like Vaultwarden). The data is retrieved using the official command line "bw" or the alternative command "rbw" (faster). Before using Rougail, the command must be logged and unlocked.
|
||||
| **Path**: bitwarden
|
||||
| `*disabled*`
|
||||
| **Disabled**: if bitwarden is not set in "select for user data" (step.user_data).
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **bitwarden.command**
|
||||
|
||||
`choice <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `multiple` `mandatory` `unique`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--bitwarden.command
|
||||
|
||||
**Environment variable**: ROUGAILCLI_BITWARDEN.COMMAND
|
||||
- Command line used to retrieve secrets.
|
||||
|
||||
Command line must be in PATH.
|
||||
|
||||
**Choices**:
|
||||
|
||||
|
||||
|
||||
- rbw **← (default)**
|
||||
|
||||
- bw **← (default)**
|
||||
|
||||
* - **bitwarden.mock_enable**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- --bitwarden.mock_enable
|
||||
|
||||
- --bitwarden.no-mock_enable
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_BITWARDEN.MOCK_ENABLE
|
||||
- Simulate password generation instead of retrieve them.
|
||||
|
||||
**Default**: false
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
Load user data from commandline parser
|
||||
=======================================
|
||||
|
||||
.. note::
|
||||
|
||||
| Load the user data from the current command line.
|
||||
| **Disabled**: if bitwarden is not set in "select for user data" (step.user_data).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,69 @@
|
|||
Load user data from a environment variable
|
||||
===========================================
|
||||
Load user data from environment variables
|
||||
=========================================
|
||||
|
||||
.. note::
|
||||
|
||||
| Variable values can be defined directly from an environment variable.
|
||||
|
|
||||
| Environnement variable names begin with a prefix (by default ROUGAIL_) followed by the variable path in uppercase, for example: ROUGAIL_MY_VARIABLE. If you are using namespaces, the prefix is the name of the namespace in uppercase.
|
||||
|
|
||||
| Note that variable paths can contain dots ("."), which are not permitted everywhere. To avoid any issues, use the `env` command, for example: `env ROUGAIL_MY_FAMILY.MY_VARIABLE=1 rougail`.
|
||||
|
|
||||
| For values, there is no difference between a number and a letter (they can be enclosed in quotes or not). However, booleans are True or False. The separator for multiple variables is a comma.
|
||||
| **Path**: environment
|
||||
| `*disabled*`
|
||||
| **Disabled**: if environment is not set in "select for user data" (step.user_data).
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **environment.default_environment_name**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
--environment.default_environment_name
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ENVIRONMENT.DEFAULT_ENVIRONMENT_NAME
|
||||
- Name of the default environment prefix.
|
||||
|
||||
**Validator**: should only use uppercase character
|
||||
|
||||
**Default**: ROUGAIL
|
||||
|
||||
* - **environment.custom_separator**
|
||||
|
||||
`string <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__
|
||||
|
||||
**Command line**:
|
||||
|
||||
--environment.custom_separator
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ENVIRONMENT.CUSTOM_SEPARATOR
|
||||
- Replace the separator character "." in path by an other.
|
||||
|
||||
The character dot (".") may not be allowed in the environment variable name. Note that the variable name with dots is always available in addition to the name with this character.
|
||||
|
||||
* - **environment.with_secrets**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- --environment.with_secrets
|
||||
|
||||
- --environment.no-with_secrets
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_ENVIRONMENT.WITH_SECRETS
|
||||
- Environnement variables may contain secrets.
|
||||
|
||||
**Default**: true
|
||||
|
|
|
|||
|
|
@ -1,21 +1,17 @@
|
|||
User data description
|
||||
User data modules
|
||||
======================
|
||||
|
||||
Rougail is a collections of subproject in order to adjust functionalities to your needs.
|
||||
Rougail is a collections of modules in order to adjust functionalities to your needs.
|
||||
|
||||
User data is one of category of subjects. The goal is to setup variable with value defined by the user.
|
||||
|
||||
There are different user data types:
|
||||
:term:`User data` is one of category of subjects. The goal is to setup variable with value defined by the :term:`operator`.
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:caption: Use library
|
||||
:caption: Available user data
|
||||
|
||||
yaml
|
||||
ansible
|
||||
environment
|
||||
commandline
|
||||
bitwarden
|
||||
commandline
|
||||
questionary
|
||||
|
||||
.. ansible
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,54 @@
|
|||
Load user data from a command line interface
|
||||
Define user data interactively in the console
|
||||
=============================================
|
||||
|
||||
.. note::
|
||||
|
||||
| The user will enter variable values in a command-line interface. The variables will be displayed one after another, allowing the user to change or add values.
|
||||
| **Path**: questionary
|
||||
| `*disabled*`
|
||||
| **Disabled**: if questionary is not set in "select for user data" (step.user_data).
|
||||
|
||||
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
|
||||
* - **questionary.mandatory**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- -qm, --questionary.mandatory
|
||||
|
||||
- -nqm, --questionary.no-mandatory
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_QUESTIONARY.MANDATORY
|
||||
- Ask values only for mandatories variables without any value.
|
||||
|
||||
**Default**: false
|
||||
|
||||
* - **questionary.show_secrets**
|
||||
|
||||
`boolean <https://rougail.readthedocs.io/en/latest/variable.html#variables-types>`__ `mandatory`
|
||||
|
||||
**Command line**:
|
||||
|
||||
|
||||
|
||||
- -qs, --questionary.show_secrets
|
||||
|
||||
- -nqs, --questionary.no-show_secrets
|
||||
|
||||
|
||||
|
||||
**Environment variable**: ROUGAILCLI_QUESTIONARY.SHOW_SECRETS
|
||||
- Show secrets instead of obscuring them.
|
||||
|
||||
**Default**: false
|
||||
|
|
|
|||
Loading…
Reference in a new issue