The debops config command¶
The debops config command provides access to DebOps configuration system. At present it can only be used to inspect the configuration options, in the future it will allow modification of them as well.
Display the configuration information about a DebOps project. Configuration is gathered from multiple places and merged together. The default display format is TOML and can be changed to JSON to allow parsing.
- Display the help and usage information
- Path to the project directory to work on. If it's not specified, the script will use the current directory.
- Display the current environment variables which will be used by DebOps and passed to Ansible during its execution. This can be used to check if the environment variables configured in various files are correctly initialized.
- Specify the format of the output. The default format is TOML which is considered human-friendly. The JSON format can be used to enable easy parsing by programs.
Use jq command to parse the DebOps configuration and extract path to the Ansible inventory:
debops config --format json | jq .views.system.ansible.defaults.inventory
DebOps uses multiple levels of configuration files that are merged together in order of appearance:
defaults.toml(built-in default configuration)
/usr/lib/debops/conf.d/(configuration included by OS distribution maintainers)
/usr/local/lib/debops/conf.d/(configuration included by Python package maintainers)
/etc/debops/conf.d/(configuration defined by local system administrators)
<project directory>/.debops.cfg(per-project configuration file, legacy)
<project directory>/.debops/conf.d/(per-project configuration directory)
Configuration directories can contain YAML, TOML and JSON configuration files;
format is detected via the file extension (respectively
.json). You can find more details about
the contents of the configuration files and overall configuration structure in
the debops config command documentation.
DebOps scripts support multiple configuration files which can be used to affect its execution environment:
<project directory>/.env(per-project environment)
You can use these files to store environment variables which are then added to the ansible-playbook environment during playbook execution.
Each environment variable is specified as:
Empty lines and lines starting with the
# character are ignored.