Compare commits

..

No commits in common. "b71f41212ade7c173478324a7fc1729997a76957" and "72deb1dc1f71b53079fa5b846445b15a15529147" have entirely different histories.

2 changed files with 8 additions and 7 deletions

View file

@ -5,7 +5,8 @@
</div> </div>
JinjaTurtle is a command-line tool to help you generate Jinja2 templates and JinjaTurtle is a command-line tool to help you generate Jinja2 templates and
Ansible inventory from a native configuration file of a piece of software. Ansible `defaults/main.yml` files from a native configuration file of a piece
of software.
## How it works ## How it works
@ -16,10 +17,10 @@ Ansible inventory from a native configuration file of a piece of software.
role. role.
* A Jinja2 file is generated from the file with those parameter key names * A Jinja2 file is generated from the file with those parameter key names
injected as the `{{ variable }}` names. injected as the `{{ variable }}` names.
* An Ansible inventory YAML file is generated with those key names and the * A `defaults/main.yml` is generated with those key names and the *values*
*values* taken from the original config file as the defaults. taken from the original config file as the defaults.
By default, the Jinja2 template and the Ansible inventory are printed to By default, the Jinja2 template and the `defaults/main.yml` are printed to
stdout. However, it is possible to output the results to new files. stdout. However, it is possible to output the results to new files.
## What sort of config files can it handle? ## What sort of config files can it handle?
@ -76,7 +77,7 @@ jinjaturtle php.ini \
``` ```
usage: jinjaturtle [-h] -r ROLE_NAME [-f {json,ini,toml,yaml,xml}] [-d DEFAULTS_OUTPUT] [-t TEMPLATE_OUTPUT] config usage: jinjaturtle [-h] -r ROLE_NAME [-f {json,ini,toml,yaml,xml}] [-d DEFAULTS_OUTPUT] [-t TEMPLATE_OUTPUT] config
Convert a config file into Ansible inventory and a Jinja2 template. Convert a config file into an Ansible defaults file and Jinja2 template.
positional arguments: positional arguments:
config Path to the source configuration file (TOML or INI-style). config Path to the source configuration file (TOML or INI-style).
@ -85,7 +86,7 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
-r, --role-name ROLE_NAME -r, --role-name ROLE_NAME
Ansible role name, used as variable prefix (e.g. cometbft). Ansible role name, used as variable prefix (e.g. cometbft).
-f, --format {ini,json,toml,xml} -f, --format {ini,toml}
Force config format instead of auto-detecting from filename. Force config format instead of auto-detecting from filename.
-d, --defaults-output DEFAULTS_OUTPUT -d, --defaults-output DEFAULTS_OUTPUT
Path to write defaults/main.yml. If omitted, defaults YAML is printed to stdout. Path to write defaults/main.yml. If omitted, defaults YAML is printed to stdout.

View file

@ -3,7 +3,7 @@
set -eo pipefail set -eo pipefail
# Clean caches etc # Clean caches etc
filedust -y . /home/user/venv-filedust/bin/filedust -y .
# Publish to Pypi # Publish to Pypi
poetry build poetry build