rougail/docs/cli.rst

187 lines
5.8 KiB
ReStructuredText
Raw Normal View History

2025-09-29 16:58:12 +02:00
:orphan:
2026-01-10 08:45:20 +01:00
The Rougail Command Line Interface
========================================
2026-02-12 11:12:22 +01:00
Les help
------------
::
rougail -u yaml -h
2026-01-10 08:45:20 +01:00
Standard usage
-----------------
::
rougail -m firefox/ -u yaml -yf config/02/config.yml
2025-09-29 16:58:12 +02:00
::
rougail --cli.versions
tiramisu: 5.2.0a9
tiramisu-cmdline-parser: 0.7.0a1
rougail: 1.2.0a29
rougail-cli: 0.2.0a19
rougail-user-data-environment: 0.1.0a9
rougail-user-data-yaml: 0.2.0a11
rougail-output-console: 0.2.0a11
rougail-output-json: 0.2.0a8
::
env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail -m structfile/proxy2.yml -u yaml environment --yaml.filename userdata/proxy.yml -o json
::
env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail -m structfile/proxy2.yml -u yaml --yaml.filename userdata/proxy.yml -o json --json.get manual.https_proxy --json.read_write
{
"address": "toto.fr",
"port": "8888"
}
2026-02-12 11:12:22 +01:00
CLI root
-------------
::
(.venv) ubuntu@monessai:~/workplace/rougail-tutorials$ env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail -m firefox/ --cli.root manual.https_proxy -u yaml environment -yf ^Cnfig/01/config.yml --cli.read_write
(.venv) ubuntu@monessai:~/workplace/rougail-tutorials$ cat config/01/config.yml
---
proxy_mode: Manual proxy configuration
manual:
http_proxy:
address: http.proxy.net
port: 3128
use_for_https: false
https_proxy:
address: https.proxy.net
(.venv) ubuntu@monessai:~/workplace/rougail-tutorials$ rougail -m firefox/ --cli.root manual.https_proxy -u yaml -yf config/01/config.yml
[WARNING]: Deprecation warnings can be disabled by setting `deprecation_warnings=False` in ansible.cfg.
[DEPRECATION WARNING]: Importing 'to_bytes' from 'ansible.module_utils._text' is deprecated. This feature will be removed from ansible-core version 2.24. Use ansible.module_utils.common.text.converters instead.
╭────────────── Caption ───────────────╮
│ Variable Default value │
│ Modified value │
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
┣━━ 📓 HTTPS address: https.proxy.net ◀ loaded from the YAML file "config/01/config.yml" (⏳ https.proxy.net ◀ loaded from the YAML file "config/01/config.yml" ⏳ http.proxy.net)
2026-02-16 18:55:51 +01:00
┗━━ 📓 HTTPS port: 3128
---
sortie normale:
sortie pour n'afficher qu'une family:
::
rougail -m firefox/ -u yaml -yf config/01/config
on a:
::
Variables:
┣━━ 📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/01/config.yml" (⏳ No proxy)
┗━━ 📂 Manual proxy configuration
┣━━ 📂 HTTP Proxy
┃ ┣━━ 📓 HTTP address: http.proxy.net ◀ loaded from the YAML file "config/01/config.yml"
┃ ┗━━ 📓 HTTP Port: 3128 ◀ loaded from the YAML file "config/01/config.yml" (⏳ 8080)
┣━━ 📓 Also use this proxy for HTTPS: false ◀ loaded from the YAML file "config/01/config.yml" (⏳ true)
┣━━ 📂 HTTPS Proxy
┃ ┣━━ 📓 HTTPS address: https.proxy.net ◀ loaded from the YAML file "config/01/config.yml" (⏳ http.proxy.net)
┃ ┗━━ 📓 HTTPS port: 3128
┗━━ 📂 SOCKS Proxy
┣━━ 📓 SOCKS address: http.proxy.net
┣━━ 📓 SOCKS port: 3128
┗━━ 📓 SOCKS host version used by proxy: v5
sortie plus précise:
::
rougail -m firefox/ -u yaml -yf config/01/config.yml --cli.root manual.https_proxy
on a:
::
Variables:
┣━━ 📓 HTTPS address: https.proxy.net ◀ loaded from the YAML file "config/01/config.yml" (⏳ https.proxy.net ◀ loaded from the YAML file "config/01/config.yml" ⏳ http.proxy.net)
2026-02-12 11:12:22 +01:00
┗━━ 📓 HTTPS port: 3128
2026-01-10 08:45:20 +01:00
Invalid user data error
-----------------------------
::
rougail -m firefox/ -u yaml -yf config/02/config.yml --cli.invalid_user_data_error
Unknown user data error
-----------------------------
2025-09-29 16:58:12 +02:00
2026-01-10 08:45:20 +01:00
l'option "`--cli.unknown_user_data_error`", ca ressemble à "`--cli.invalid_user_data_error`" mais ca concerne là les variables inconnues (ou ici désactivé ou hidden mais ca reviens au meme pour moi) chargés dans des user data.
2025-09-29 16:58:12 +02:00
2026-01-10 08:45:20 +01:00
https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/README.md#output-when-unknown-user-data-is-an-error
2026-01-28 16:15:02 +01:00
.. note:: The `--cli.unknown_user_data_error` option changes the behaviour of the Rougail CLI's standard output:
when an unknown (or disabled or hidden) variable is declared in the :term:`user data file <user data>`
then it appears in the output as an error instead of a warning.
2026-02-12 11:12:22 +01:00
Le output doc
----------------
::
rougail -m structure.yml -o doc --doc.output_format github > README.md
Le formatter
----------------
::
<gnunux> on va maintenant vérifier le formatage du fichier
<gnunux> rougail -o formatter -m structure.yml > a.yml; mv a.yml structure.yml
Les namespaces
-----------------
::
rougail -m structure.yml -u yaml -yf userdata.yml -s intranet -xn hosts -xd 0 hosts.yml
::
rougail -m structure.yml -u yaml -yf userdata.yml -s intranet -xn hosts orem srem prom -xd 0 hosts.yml -xd 1 packages/OREM -xd 2 packages/SREM -xd 3 packages/SREP
L'export ansible
-------------------
rougail -m structure.yml -u yaml -yf userdata.yml -s intranet -xn hosts -xd 0 hosts.yml -o ansible > ansible.json
::
ansible-inventory -i $(which rougail) --list
<gnunux> voir si ansible liste bien ton inventaire :)
::
ansible-inventory -i $(which rougail) --host tutu.fr
::
ansible-playbook -i $(which rougail) install.yml
2026-01-28 16:15:02 +01:00