fix: user-data-ansible can set a personalise source
This commit is contained in:
parent
a4fefee09d
commit
eb0f5901ab
8 changed files with 107 additions and 43 deletions
23
README.fr.md
Normal file
23
README.fr.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
gitea: none
|
||||
include_toc: true
|
||||
---
|
||||
[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md)
|
||||
|
||||
===============
|
||||
{}
|
||||
## Charge les données utilisateur depuis un fichier compatible avec Ansible
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> **Chemin** : ansible\
|
||||
> *`désactivé`*\
|
||||
> **Désactivé** : si ansible n'est pas définit dans "[Sélection pour données utilisateur](#step.user_data)"
|
||||
|
||||
| Variable | Description | Valeur par défaut | Type | Contrôle des accès | Validateur |
|
||||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|---------------------|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **<a id="ansible.filename" name="ansible.filename">ansible.filename</a>**<br/>**Ligne de commande** : <br/>--ansible.filename<br/>**Variable d'environnement** : ANSIBLE.FILENAME | Nom du fichier d'inventaire Ansible. | | [`UNIX filename`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `obligatoire` | *`désactivé`*<br/>**Désactivé** : si ansible n'est pas définit dans "[Sélection pour données utilisateur](#step.user_data)" | `unique`<br/>• le nom de fichier peut être une chemin relatif<br/>• le fichier doit exister<br/>• type de fichier autorisé: "file". |
|
||||
| **<a id="ansible.secret" name="ansible.secret">ansible.secret</a>**<br/>**Ligne de commande** : <br/>--ansible.secret<br/>**Variable d'environnement** : ANSIBLE.SECRET | Secret pour déchiffrer le fichier. | | [`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | *`désactivé`*<br/>**Désactivé** : si ansible n'est pas définit dans "[Sélection pour données utilisateur](#step.user_data)" | |
|
||||
| **<a id="ansible.file_with_secrets" name="ansible.file_with_secrets">ansible.file_with_secrets</a>**<br/>**Ligne de commande** : <br/>--ansible.file_with_secrets<br/>**Variable d'environnement** : ANSIBLE.FILE_WITH_SECRETS | Les fichiers Ansible qui peuvent contenir des secrets. | all | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | *`désactivé`*<br/>**Désactivé** : si ansible n'est pas définit dans "[Sélection pour données utilisateur](#step.user_data)" | **Choix** : <br/>• all<br/>• first<br/>• last<br/>• none |
|
||||
|
||||
|
||||
23
README.md
23
README.md
|
|
@ -1,2 +1,23 @@
|
|||
# rougail-user-data-ansible
|
||||
---
|
||||
gitea: none
|
||||
include_toc: true
|
||||
---
|
||||
[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md)
|
||||
|
||||
===============
|
||||
{}
|
||||
## Load user data from Ansible compatible file
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> **Path**: ansible\
|
||||
> *`disabled`*\
|
||||
> **Disabled**: if ansible is not set in "[Select for user datas](#step.user_data)"
|
||||
|
||||
| Variable | Description | Default value | Type | Access control | Validator |
|
||||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|-----------------|------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **<a id="ansible.filename" name="ansible.filename">ansible.filename</a>**<br/>**Command line**: <br/>--ansible.filename<br/>**Environment variable**: ANSIBLE.FILENAME | Ansible filename inventory. | | [`UNIX filename`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `mandatory` | *`disabled`*<br/>**Disabled**: if ansible is not set in "[Select for user datas](#step.user_data)" | `unique`<br/>• this filename could be a relative path<br/>• this file must exist<br/>• file type allowed: "file". |
|
||||
| **<a id="ansible.secret" name="ansible.secret">ansible.secret</a>**<br/>**Command line**: <br/>--ansible.secret<br/>**Environment variable**: ANSIBLE.SECRET | Secret to decrypt file. | | [`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | *`disabled`*<br/>**Disabled**: if ansible is not set in "[Select for user datas](#step.user_data)" | |
|
||||
| **<a id="ansible.file_with_secrets" name="ansible.file_with_secrets">ansible.file_with_secrets</a>**<br/>**Command line**: <br/>--ansible.file_with_secrets<br/>**Environment variable**: ANSIBLE.FILE_WITH_SECRETS | Ansible files that may contain secrets. | all | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | *`disabled`*<br/>**Disabled**: if ansible is not set in "[Select for user datas](#step.user_data)" | **Choices**: <br/>• all<br/>• first<br/>• last<br/>• none |
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: 2025-02-10 09:15+0100\n"
|
||||
"PO-Revision-Date: 2025-02-10 09:15+0100\n"
|
||||
"POT-Creation-Date: 2026-02-11 21:30+0100\n"
|
||||
"PO-Revision-Date: 2026-02-11 21:31+0100\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: fr\n"
|
||||
|
|
@ -14,26 +14,38 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: pygettext.py 1.5\n"
|
||||
"X-Generator: Poedit 3.5\n"
|
||||
"X-Generator: Poedit 3.8\n"
|
||||
|
||||
#: src/rougail/user_data_ansible/__init__.py:47
|
||||
#: src/rougail/user_data_ansible/__init__.py:48
|
||||
msgid "ansible is not set in step.user_data"
|
||||
msgstr "ansible n'est pas définit dans step.user_data"
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:30
|
||||
msgid "Configuration of user data Ansible"
|
||||
msgstr "Configuration des données utilisateurs Ansible"
|
||||
#: src/rougail/user_data_ansible/__init__.py:56
|
||||
msgid "the Ansible file \"{0}\""
|
||||
msgstr "le ficher Ansible \"{0}\""
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:39
|
||||
#: src/rougail/user_data_ansible/config.py:30
|
||||
msgid "Load user data from Ansible compatible file"
|
||||
msgstr "Charge les données utilisateur depuis un fichier compatible avec Ansible"
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:35
|
||||
#: src/rougail/user_data_ansible/config.py:50
|
||||
#: src/rougail/user_data_ansible/config.py:59
|
||||
#: src/rougail/user_data_ansible/config.py:73
|
||||
msgid "if ansible is not set in \"step.user_data\""
|
||||
msgstr "si ansible n'est pas définit dans \"step.user_data\""
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:38
|
||||
msgid "Ansible filename inventory"
|
||||
msgstr "Nom du fichier d'inventaire Ansible"
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:55
|
||||
#: src/rougail/user_data_ansible/config.py:53
|
||||
msgid "Secret to decrypt file"
|
||||
msgstr "Secret pour déchiffrer le fichier"
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:65
|
||||
#, fuzzy
|
||||
#| msgid "Ansible file that may contain passwords"
|
||||
msgid "Ansible file that may contain secrets"
|
||||
msgstr "Fichier Ansible qui peuvent contenir des secrets"
|
||||
#: src/rougail/user_data_ansible/config.py:62
|
||||
msgid "Ansible files that may contain secrets"
|
||||
msgstr "Les fichiers Ansible qui peuvent contenir des secrets"
|
||||
|
||||
#~ msgid "Configuration of user data Ansible"
|
||||
#~ msgstr "Configuration des données utilisateurs Ansible"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2025-10-10 08:05+0200\n"
|
||||
"POT-Creation-Date: 2026-02-11 21:31+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -19,19 +19,30 @@ msgstr ""
|
|||
msgid "ansible is not set in step.user_data"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:30
|
||||
msgid "Configuration of user data Ansible"
|
||||
#: src/rougail/user_data_ansible/__init__.py:56
|
||||
msgid "the Ansible file \"{0}\""
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:39
|
||||
#: src/rougail/user_data_ansible/config.py:30
|
||||
msgid "Load user data from Ansible compatible file"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:35
|
||||
#: src/rougail/user_data_ansible/config.py:50
|
||||
#: src/rougail/user_data_ansible/config.py:59
|
||||
#: src/rougail/user_data_ansible/config.py:73
|
||||
msgid "if ansible is not set in \"step.user_data\""
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:38
|
||||
msgid "Ansible filename inventory"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:55
|
||||
#: src/rougail/user_data_ansible/config.py:53
|
||||
msgid "Secret to decrypt file"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/user_data_ansible/config.py:65
|
||||
msgid "Ansible file that may contain secrets"
|
||||
#: src/rougail/user_data_ansible/config.py:62
|
||||
msgid "Ansible files that may contain secrets"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"""
|
||||
Silique (https://www.silique.fr)
|
||||
Copyright (C) 2024-2025
|
||||
Copyright (C) 2024-2026
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by the
|
||||
|
|
@ -53,6 +53,7 @@ class RougailUserDataAnsible(RougailUserDataYaml):
|
|||
self.config = config
|
||||
self.errors = []
|
||||
self.warnings = []
|
||||
self.source = _('the Ansible file "{0}"')
|
||||
|
||||
def open(self, filename: str) -> dict:
|
||||
"""Open file
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"""
|
||||
Silique (https://www.silique.fr)
|
||||
Copyright (C) 2024-2025
|
||||
Copyright (C) 2024-2026
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by the
|
||||
|
|
@ -27,13 +27,12 @@ def get_rougail_config(
|
|||
# or create a new only only for user data
|
||||
options = f"""
|
||||
ansible:
|
||||
description: {_("Configuration of user data Ansible")}
|
||||
description: {_("Load user data from Ansible compatible file")}
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: |
|
||||
{{% if step.user_data is propertyerror or 'ansible' not in step.user_data %}}
|
||||
disabled
|
||||
{{% endif %}}
|
||||
{{{{ _.step.user_data is propertyerror or 'ansible' not in _.step.user_data }}}}
|
||||
return_type: boolean
|
||||
description: {_('if ansible is not set in "step.user_data"')}
|
||||
|
||||
filename:
|
||||
description: {_("Ansible filename inventory")}
|
||||
|
|
@ -45,24 +44,22 @@ ansible:
|
|||
types:
|
||||
- file
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: |
|
||||
{{% if step.user_data is propertyerror or 'ansible' not in step.user_data %}}
|
||||
disabled
|
||||
{{% endif %}}
|
||||
{{{{ _.step.user_data is propertyerror or 'ansible' not in _.step.user_data }}}}
|
||||
return_type: boolean
|
||||
description: {_('if ansible is not set in "step.user_data"')}
|
||||
|
||||
secret:
|
||||
description: {_("Secret to decrypt file")}
|
||||
type: secret
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: |
|
||||
{{% if step.user_data is propertyerror or 'ansible' not in step.user_data %}}
|
||||
disabled
|
||||
{{% endif %}}
|
||||
{{{{ _.step.user_data is propertyerror or 'ansible' not in _.step.user_data }}}}
|
||||
return_type: boolean
|
||||
description: {_('if ansible is not set in "step.user_data"')}
|
||||
|
||||
file_with_secrets:
|
||||
description: {_("Ansible file that may contain secrets")}
|
||||
description: {_("Ansible files that may contain secrets")}
|
||||
default: all
|
||||
choices:
|
||||
- all
|
||||
|
|
@ -70,11 +67,10 @@ ansible:
|
|||
- last
|
||||
- none
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: |
|
||||
{{% if step.user_data is propertyerror or 'ansible' not in step.user_data %}}
|
||||
disabled
|
||||
{{% endif %}}
|
||||
{{{{ _.step.user_data is propertyerror or 'ansible' not in _.step.user_data }}}}
|
||||
return_type: boolean
|
||||
description: {_('if ansible is not set in "step.user_data"')}
|
||||
"""
|
||||
return {
|
||||
"name": "ansible",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"""Internationalisation utilities
|
||||
Silique (https://www.silique.fr)
|
||||
Copyright (C) 2024-2025
|
||||
Copyright (C) 2024-2026
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by the
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue