From 6d2bc9592b8c067d728e9708773e901a7a8310db Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 10 Feb 2025 09:17:59 +0100 Subject: [PATCH] feat: add new parameter ansible.file_with_secrets --- locale/fr/LC_MESSAGES/user_data_ansible.po | 24 +++++++++++-- locale/user_data_ansible.pot | 20 +++++++++-- src/rougail/user_data_ansible/__init__.py | 3 +- src/rougail/user_data_ansible/config.py | 32 ++++++++++++------ src/rougail/user_data_ansible/i18n.py | 2 +- .../fr/LC_MESSAGES/user_data_ansible.mo | Bin 419 -> 679 bytes 6 files changed, 63 insertions(+), 18 deletions(-) diff --git a/locale/fr/LC_MESSAGES/user_data_ansible.po b/locale/fr/LC_MESSAGES/user_data_ansible.po index 746fc99..7d9ed13 100644 --- a/locale/fr/LC_MESSAGES/user_data_ansible.po +++ b/locale/fr/LC_MESSAGES/user_data_ansible.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2024-11-27 16:19+0100\n" -"PO-Revision-Date: 2024-11-27 16:21+0100\n" +"POT-Creation-Date: 2025-02-10 09:15+0100\n" +"PO-Revision-Date: 2025-02-10 09:15+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -16,6 +16,24 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" "X-Generator: Poedit 3.5\n" -#: src/rougail/user_data_ansible/__init__.py:46 +#: src/rougail/user_data_ansible/__init__.py:47 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/config.py:39 +msgid "Ansible filename inventory" +msgstr "Nom du fichier d'inventaire Ansible" + +#: src/rougail/user_data_ansible/config.py:55 +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" diff --git a/locale/user_data_ansible.pot b/locale/user_data_ansible.pot index af651fe..9771974 100644 --- a/locale/user_data_ansible.pot +++ b/locale/user_data_ansible.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-11-27 16:21+0100\n" +"POT-Creation-Date: 2025-02-10 09:16+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,7 +15,23 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: src/rougail/user_data_ansible/__init__.py:46 +#: src/rougail/user_data_ansible/__init__.py:47 msgid "ansible is not set in step.user_data" msgstr "" +#: src/rougail/user_data_ansible/config.py:30 +msgid "Configuration of user data Ansible" +msgstr "" + +#: src/rougail/user_data_ansible/config.py:39 +msgid "Ansible filename inventory" +msgstr "" + +#: src/rougail/user_data_ansible/config.py:55 +msgid "Secret to decrypt file" +msgstr "" + +#: src/rougail/user_data_ansible/config.py:65 +msgid "Ansible file that may contain secrets" +msgstr "" + diff --git a/src/rougail/user_data_ansible/__init__.py b/src/rougail/user_data_ansible/__init__.py index cdd9e81..3633cfe 100644 --- a/src/rougail/user_data_ansible/__init__.py +++ b/src/rougail/user_data_ansible/__init__.py @@ -1,6 +1,6 @@ """ Silique (https://www.silique.fr) -Copyright (C) 2024 +Copyright (C) 2024-2025 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 @@ -48,6 +48,7 @@ class RougailUserDataAnsible(RougailUserDataYaml): self.rougailconfig = rougailconfig self.filenames = self.rougailconfig["ansible.filename"] self.secret = self.rougailconfig["ansible.secret"] + self.file_with_secrets = self.rougailconfig["ansible.file_with_secrets"] self.config = config self.errors = [] self.warnings = [] diff --git a/src/rougail/user_data_ansible/config.py b/src/rougail/user_data_ansible/config.py index 5a8f818..d73b420 100644 --- a/src/rougail/user_data_ansible/config.py +++ b/src/rougail/user_data_ansible/config.py @@ -1,6 +1,6 @@ """ Silique (https://www.silique.fr) -Copyright (C) 2024 +Copyright (C) 2024-2025 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 @@ -15,6 +15,7 @@ details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ +from .i18n import _ def get_rougail_config( @@ -24,18 +25,18 @@ def get_rougail_config( """get rougail config for ansible""" # redefine ansible family if already exists (for output) # or create a new only only for user data - options = """ + options = f""" ansible: - description: Configuration of user data Ansible + description: {_("Configuration of user data Ansible")} disabled: type: jinja jinja: | - {% if 'ansible' not in step.user_data %} + {{% if 'ansible' not in step.user_data %}} disabled - {% endif %} + {{% endif %}} filename: - description: Ansible filename inventory + description: {_("Ansible filename inventory")} type: unix_filename multi: true params: @@ -46,19 +47,28 @@ ansible: disabled: type: jinja jinja: | - {% if 'ansible' not in step.user_data %} + {{% if 'ansible' not in step.user_data %}} disabled - {% endif %} + {{% endif %}} secret: - description: Secret to decrypt file + description: {_("Secret to decrypt file")} type: secret disabled: type: jinja jinja: | - {% if 'ansible' not in step.user_data %} + {{% if 'ansible' not in step.user_data %}} disabled - {% endif %} + {{% endif %}} + + file_with_secrets: + description: {_("Ansible file that may contain secrets")} + default: all + choices: + - all + - first + - last + - none """ return { "name": "ansible", diff --git a/src/rougail/user_data_ansible/i18n.py b/src/rougail/user_data_ansible/i18n.py index 605ae65..c0b944d 100644 --- a/src/rougail/user_data_ansible/i18n.py +++ b/src/rougail/user_data_ansible/i18n.py @@ -1,6 +1,6 @@ """Internationalisation utilities Silique (https://www.silique.fr) -Copyright (C) 2024 +Copyright (C) 2024-2025 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 diff --git a/src/rougail/user_data_ansible/locale/fr/LC_MESSAGES/user_data_ansible.mo b/src/rougail/user_data_ansible/locale/fr/LC_MESSAGES/user_data_ansible.mo index 8a10f34f52a7c333cef44d463b12f58b289a7f05..99b33b51388f2a6c716e7825326b794ef8cdfe33 100644 GIT binary patch delta 379 zcmY+9y-EW?6ov1)305{17GiPnhg8vxkU~4rS^{D#jM*6-*vy3a5d%V6Era+31|)?~ zks@!AHxWF$E(>1xI0xp=Io!|mt36$Bw>}8d27BNNY=Q!m^9pvs8`uYPume`$5Ujxu zNE4z1XtF_c0zHD3`?t_z=ra^6&7^SXyrUKj-iR)Y*Y|~Fr3-1qNU}Ch(gf=!bZL#! z57CLBtzoM;dg(Y9L2&(xZsgF(z`=43HyMX2XEqpY^}E?=x0i8tcHZmHzE{(0JK{Xz zefX%$n9g63&`vgS{~L4ZIk(0v7cepCLVFQpbiUcI>&G@CaJfLTQV!wOJyj2h`o8y< Gr1J|pmSOV% delta 110 zcmZ3^x|liOo)F7a1|VPpVi_RT0b*7lwgF-g2moRgAPxlLzd&3D#Ckwn!pOh?L|_2Y g3j-7H2Jo8b8XD>vnJXBYSs58lwqiU!xq?X_0E!?Dt^fc4