142 lines
4.3 KiB
ReStructuredText
142 lines
4.3 KiB
ReStructuredText
:orphan:
|
|
|
|
The Rougail Command Line Interface
|
|
========================================
|
|
|
|
Les help
|
|
------------
|
|
|
|
::
|
|
|
|
rougail -u yaml -h
|
|
|
|
|
|
Standard usage
|
|
-----------------
|
|
|
|
::
|
|
|
|
rougail -m firefox/ -u yaml -yf config/02/config.yml
|
|
|
|
|
|
|
|
::
|
|
|
|
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"
|
|
}
|
|
|
|
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)
|
|
┗━━ 📓 HTTPS port: 3128
|
|
|
|
|
|
Invalid user data error
|
|
-----------------------------
|
|
|
|
::
|
|
|
|
rougail -m firefox/ -u yaml -yf config/02/config.yml --cli.invalid_user_data_error
|
|
|
|
Unknown user data error
|
|
-----------------------------
|
|
|
|
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.
|
|
|
|
https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_050/README.md#output-when-unknown-user-data-is-an-error
|
|
|
|
.. 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.
|
|
|
|
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
|
|
|