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.

debops config

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.

Options

-h, --help
Display the help and usage information
--project-dir <project_dir>
Path to the project directory to work on. If it's not specified, the script will use the current directory.
--env
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.
--format json|toml
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.

Examples

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

Configuration files

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)
  • $XDG_CONFIG_HOME/debops/conf.d/ (per-user configuration)
  • <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 .yml or .yaml, .toml or .json). You can find more details about the contents of the configuration files and overall configuration structure in the debops config command documentation.

Environment files

DebOps scripts support multiple configuration files which can be used to affect its execution environment:

  • /etc/default/debops (per-system environment)
  • $XDG_CONFIG_HOME/debops/environment (per-user 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:

NAME=value

Empty lines and lines starting with the # character are ignored.