diff --git a/README.fr.md b/README.fr.md new file mode 100644 index 0000000..9468f9d --- /dev/null +++ b/README.fr.md @@ -0,0 +1,21 @@ +--- +gitea: none +include_toc: true +--- +[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) + +## Génère un inventaire Ansible + +> [!NOTE] +> +> **Chemin** : ansible\ +> *`désactivé`*\ +> **Désactivé** : lorsque la variable "[Sélection pour sortie](#step.output)" est acessible et n'a pas la valeur "ansible" + +| Variable | Description | Valeur par défaut | Type | +|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|---------------------|---------------------------------------------------------------------------------------------------| +| **ansible.host_namespace**
**Ligne de commande** : --ansible.host_namespace
**Variable d'environnement** : ANSIBLE.HOST_NAMESPACE | Espace de nom avec les valeurs de l'hĂ´te. | hosts | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | +| **ansible.no_namespace_in_vars**
**Ligne de commande** :
• --ansible.no_namespace_in_vars
• --ansible.no-no_namespace_in_vars
**Variable d'environnement** : ANSIBLE.NO_NAMESPACE_IN_VARS | Supprime le nom de l'espace de nom dans les vars de l'hĂ´te. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | +| **ansible.export_warnings**
**Ligne de commande** :
• --ansible.export_warnings
• --ansible.no-export_warnings
**Variable d'environnement** : ANSIBLE.EXPORT_WARNINGS | Affiche les avertissements dans les données d'exportation Ansible. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | + + diff --git a/README.md b/README.md index 9a33de1..e37e8b5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,21 @@ -# rougail-output-ansible +--- +gitea: none +include_toc: true +--- +[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) + +## Generate Ansible inventory + +> [!NOTE] +> +> **Path**: ansible\ +> *`disabled`*\ +> **Disabled**: when the variable "[Select for output](#step.output)" is accessible and hasn't the value "ansible" + +| Variable | Description | Default value | Type | +|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|-----------------|-------------------------------------------------------------------------------------------------| +| **ansible.host_namespace**
**Command line**: --ansible.host_namespace
**Environment variable**: ANSIBLE.HOST_NAMESPACE | Namespace with host values. | hosts | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | +| **ansible.no_namespace_in_vars**
**Command line**:
• --ansible.no_namespace_in_vars
• --ansible.no-no_namespace_in_vars
**Environment variable**: ANSIBLE.NO_NAMESPACE_IN_VARS | Remove namespace name in host vars. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | +| **ansible.export_warnings**
**Command line**:
• --ansible.export_warnings
• --ansible.no-export_warnings
**Environment variable**: ANSIBLE.EXPORT_WARNINGS | Displays warnings inside Ansible exportation datas. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | + diff --git a/locale/fr/LC_MESSAGES/rougail_output_ansible.po b/locale/fr/LC_MESSAGES/rougail_output_ansible.po index afb334b..4c3767c 100644 --- a/locale/fr/LC_MESSAGES/rougail_output_ansible.po +++ b/locale/fr/LC_MESSAGES/rougail_output_ansible.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2025-11-21 08:24+0100\n" -"PO-Revision-Date: 2025-11-21 08:24+0100\n" +"POT-Creation-Date: 2025-12-23 21:31+0100\n" +"PO-Revision-Date: 2025-12-23 21:33+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -16,21 +16,21 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" "X-Generator: Poedit 3.8\n" -#: src/rougail/output_ansible/__init__.py:59 +#: src/rougail/output_ansible/__init__.py:66 msgid "no namespace configured" msgstr "aucun espace de nom configuré" -#: src/rougail/output_ansible/__init__.py:68 +#: src/rougail/output_ansible/__init__.py:76 msgid "cannot find host namespace \"{0}\"" msgstr "ne peut trouve l'espace de nom de l'hôte \"{0}\"" -#: src/rougail/output_ansible/__init__.py:75 +#: src/rougail/output_ansible/__init__.py:83 msgid "malformated host namespace \"{0}\", should have the \"hostnames\" key" msgstr "" "l'espace de nom de l'hôte \"{0}\" est mal formaté, devrait avoir la clé " "\"hostnames\"" -#: src/rougail/output_ansible/__init__.py:105 +#: src/rougail/output_ansible/__init__.py:114 msgid "cannot find \"hostnames\" in \"{0}\" namespace" msgstr "ne peut trouve \"hostnames\" dans l'espace de nom \"{0}\"" @@ -38,26 +38,44 @@ msgstr "ne peut trouve \"hostnames\" dans l'espace de nom \"{0}\"" msgid "parameter added only to be compatible with Ansible" msgstr "paramètre ajouté seulement pour être compatible avec Ansible" -#: src/rougail/output_ansible/config.py:53 -msgid "Configuration of user data or output Ansible" -msgstr "Configuration de Ansible comme donnée utilisateur ou sortie" +#: src/rougail/output_ansible/config.py:36 +msgid "if ansible is not set in \"step.output\"" +msgstr "si ansible n'est pas défini dans \"step.output\"" -#: src/rougail/output_ansible/config.py:65 -msgid "Configuration of output Ansible" -msgstr "Configuration de la sortie Ansible" +#: src/rougail/output_ansible/config.py:43 +msgid "if ansible or json are not set in \"step.output\"" +msgstr "si ansible ou json ne sont pas définis dans \"step.output\"" -#: src/rougail/output_ansible/config.py:77 +#: src/rougail/output_ansible/config.py:50 +msgid "Load Ansible encrypt inventory or generate Ansible inventory" +msgstr "Charge un inventaire chiffré Ansible ou génère un inventaire Ansible" + +#: src/rougail/output_ansible/config.py:55 +msgid "if ansible is not in \"step.output\" and not in \"step.user_data\"" +msgstr "si ansible n'est pas dans \"step.output\" ni dans \"step.user_data\"" + +#: src/rougail/output_ansible/config.py:61 +msgid "Generate Ansible inventory" +msgstr "Génère un inventaire Ansible" + +#: src/rougail/output_ansible/config.py:72 msgid "Namespace with host values" msgstr "Espace de nom avec les valeurs de l'hôte" -#: src/rougail/output_ansible/config.py:81 +#: src/rougail/output_ansible/config.py:74 msgid "Remove namespace name in host vars" msgstr "Supprime le nom de l'espace de nom dans les vars de l'hôte" -#: src/rougail/output_ansible/config.py:85 +#: src/rougail/output_ansible/config.py:76 msgid "Displays warnings inside Ansible exportation datas" msgstr "Affiche les avertissements dans les données d'exportation Ansible" +#~ msgid "Configuration of user data or output Ansible" +#~ msgstr "Configuration de Ansible comme donnée utilisateur ou sortie" + +#~ msgid "Configuration of output Ansible" +#~ msgstr "Configuration de la sortie Ansible" + #~ msgid "Only variables in host namespace is available by a host" #~ msgstr "" #~ "Seules les variables de l'espace de nom de l'hôte est valable pour un hôte" diff --git a/locale/rougail_output_ansible.pot b/locale/rougail_output_ansible.pot index 8e60e5d..c401066 100644 --- a/locale/rougail_output_ansible.pot +++ b/locale/rougail_output_ansible.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-11-21 08:24+0100\n" +"POT-Creation-Date: 2025-12-23 21:34+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,19 +15,19 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: src/rougail/output_ansible/__init__.py:59 +#: src/rougail/output_ansible/__init__.py:66 msgid "no namespace configured" msgstr "" -#: src/rougail/output_ansible/__init__.py:68 +#: src/rougail/output_ansible/__init__.py:76 msgid "cannot find host namespace \"{0}\"" msgstr "" -#: src/rougail/output_ansible/__init__.py:75 +#: src/rougail/output_ansible/__init__.py:83 msgid "malformated host namespace \"{0}\", should have the \"hostnames\" key" msgstr "" -#: src/rougail/output_ansible/__init__.py:105 +#: src/rougail/output_ansible/__init__.py:114 msgid "cannot find \"hostnames\" in \"{0}\" namespace" msgstr "" @@ -35,23 +35,35 @@ msgstr "" msgid "parameter added only to be compatible with Ansible" msgstr "" -#: src/rougail/output_ansible/config.py:53 -msgid "Configuration of user data or output Ansible" +#: src/rougail/output_ansible/config.py:36 +msgid "if ansible is not set in \"step.output\"" msgstr "" -#: src/rougail/output_ansible/config.py:65 -msgid "Configuration of output Ansible" +#: src/rougail/output_ansible/config.py:43 +msgid "if ansible or json are not set in \"step.output\"" msgstr "" -#: src/rougail/output_ansible/config.py:77 +#: src/rougail/output_ansible/config.py:50 +msgid "Load Ansible encrypt inventory or generate Ansible inventory" +msgstr "" + +#: src/rougail/output_ansible/config.py:55 +msgid "if ansible is not in \"step.output\" and not in \"step.user_data\"" +msgstr "" + +#: src/rougail/output_ansible/config.py:61 +msgid "Generate Ansible inventory" +msgstr "" + +#: src/rougail/output_ansible/config.py:72 msgid "Namespace with host values" msgstr "" -#: src/rougail/output_ansible/config.py:81 +#: src/rougail/output_ansible/config.py:74 msgid "Remove namespace name in host vars" msgstr "" -#: src/rougail/output_ansible/config.py:85 +#: src/rougail/output_ansible/config.py:76 msgid "Displays warnings inside Ansible exportation datas" msgstr "" diff --git a/src/rougail/output_ansible/config.py b/src/rougail/output_ansible/config.py index 1dcb412..30518db 100644 --- a/src/rougail/output_ansible/config.py +++ b/src/rougail/output_ansible/config.py @@ -30,39 +30,35 @@ list: description: {_('parameter added only to be compatible with Ansible')} default: false disabled: - type: jinja - jinja: | - {{% if step.output is propertyerror or step.output != 'ansible' %}} - disabled - {{% endif %}} + jinja: |- + {{{{ step.output is propertyerror or step.output != 'ansible' }}}} + return_type: boolean + description: {_('if ansible is not set in "step.output"')} json: redefine: true disabled: - type: jinja - jinja: | - {{% if step.output is propertyerror or (step.output != 'json' and step.output != 'ansible') %}} - disabled - {{% endif %}} + jinja: |- + {{{{ step.output is propertyerror or (step.output != 'json' and step.output != 'ansible') }}}} + description: {_('if ansible or json are not set in "step.output"')} """, f""" ansible: exists: true redefine: true - description: {_('Configuration of user data or output Ansible')} + description: {_('Load Ansible encrypt inventory or generate Ansible inventory')} disabled: - type: jinja - jinja: | - {{% if step.output is propertyerror or (step.output != 'ansible' and (step.user_data is propertyerror or 'ansible' not in step.user_data)) %}} - disabled - {{% endif %}} + jinja: |- + {{{{ step.output is propertyerror or (step.output != 'ansible' and (step.user_data is propertyerror or 'ansible' not in step.user_data)) }}}} + return_type: boolean + description: {_('if ansible is not in "step.output" and not in "step.user_data"')} """, f""" ansible: type: family - description: {_('Configuration of output Ansible')} + description: {_('Generate Ansible inventory')} exists: false disabled: variable: step.output @@ -73,17 +69,11 @@ ansible: f""" ansible: - host_namespace: - description: {_('Namespace with host values')} - default: "hosts" + host_namespace: hosts # {_('Namespace with host values')} - no_namespace_in_vars: - description: {_('Remove namespace name in host vars')} - default: false + no_namespace_in_vars: false # {_('Remove namespace name in host vars')} - export_warnings: - description: {_('Displays warnings inside Ansible exportation datas')} - default: true + export_warnings: true # {_('Displays warnings inside Ansible exportation datas')} """, ] return { diff --git a/src/rougail/output_ansible/locale/fr/LC_MESSAGES/rougail_output_ansible.mo b/src/rougail/output_ansible/locale/fr/LC_MESSAGES/rougail_output_ansible.mo index 2ae817a..f28bf2d 100644 Binary files a/src/rougail/output_ansible/locale/fr/LC_MESSAGES/rougail_output_ansible.mo and b/src/rougail/output_ansible/locale/fr/LC_MESSAGES/rougail_output_ansible.mo differ