rougail-user-data-yaml/src/rougail/user_data_yaml/config.py

65 lines
1.6 KiB
Python
Raw Normal View History

2024-07-28 21:53:00 +02:00
"""
2024-12-11 21:29:44 +01:00
Config yaml for Rougail-user-data
2024-07-28 21:53:00 +02:00
Silique (https://www.silique.fr)
Copyright (C) 2024-2025
2024-07-28 21:53:00 +02:00
2024-11-01 12:15:39 +01:00
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
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
2024-07-28 21:53:00 +02:00
"""
2025-05-11 18:06:37 +02:00
from .i18n import _
2024-07-28 21:53:00 +02:00
2024-11-01 12:15:39 +01:00
def get_rougail_config(
*,
backward_compatibility=True,
) -> dict:
options = f"""
2024-12-11 21:29:44 +01:00
yaml:
description: {_("Configuration rougail-user-data-yaml")}
2024-07-28 21:53:00 +02:00
disabled:
type: jinja
jinja: |
2025-05-02 08:14:19 +02:00
{{% if step.user_data is propertyerror or 'yaml' not in step.user_data %}}
2024-07-28 21:53:00 +02:00
disabled
{{% endif %}}
2024-07-28 21:53:00 +02:00
filename:
description: {_("File or directory name where user datas are stored")}
2024-07-28 21:53:00 +02:00
alternative_name: ff
type: unix_filename
2024-11-01 12:15:39 +01:00
multi: true
2024-07-28 21:53:00 +02:00
params:
allow_relative: True
test_existence: True
file_with_secrets:
description: {_("File that may contain secrets")}
default: all
choices:
- all
- first
- last
- none
2024-07-28 21:53:00 +02:00
"""
2024-11-01 12:15:39 +01:00
return {
2024-12-11 21:29:44 +01:00
"name": "yaml",
2024-11-01 12:15:39 +01:00
"process": "user data",
"options": options,
"level": 50,
}
2024-07-28 21:53:00 +02:00
2024-11-01 12:15:39 +01:00
__all__ = "get_rougail_config"