adjutant/doc/source/configuration.rst
Adrian Turjak c750fd6d6c Rework Adjutant's config system to use CONFspirator
CONFspirator was written to just specifically for Adjutant
and it allows us to do oslo.config style config management
and definition with nested groups and for yaml.

This is a major change that touches vast amounts of the
code simply because of how much the config touches.

Actions, Tasks, DelegateAPIs, and Notification Handlers
now can define config in their own class and this will
be added to the config.

All the other config is located in `adjutant.config`,
with everything now registed nicely on the config tree,
and grouped in much saner ways.

CONFspirator will also now allow Adjutant to be entirely
configured via environment variables.

We have removed `modify_dict_settings` because that is
now entirely handled by CONFspirator's test utils.

`NotificationEngine`s are now `NotificationHandler`s.

`test_settings.py` is gone! And we now have better ways
to define test settings and defaults.

Project line length bumped to 88, and bugbear added to enforce
that instead.

Story: 2004488

Change-Id: I1d97d72d06b3a3a5df90355d3a4b4fe414381424
2020-02-05 19:07:04 +13:00

85 lines
2.9 KiB
ReStructuredText

Configuring Adjutant
====================
Adjutant is designed to be highly configurable for various needs. The goal
of Adjutant is to provide a variety of common tasks and actions that can
be easily extended or changed based upon the needs of your OpenStack cluster.
For configuration Adjutant uses a library called CONFspirator to define and
register our config values. This makes the app better at processing defaults
and checking the validity of the config.
An example Adjutant config file is found in conf/adjutant.yaml, and a new one
can be generated by running::
tox -e venv -- adjutant-api exampleconfig --output-file /etc/adjutant/adjutant.yaml
With ``--output-file`` controlling where the file goes.
This example file should be your starting point for configuring the service,
and your core source of documentation for what each config does.
Adjutant will read the file from ``/etc/adjutant/adjutant.yaml`` or if the
environment variable ``ADJUTANT_CONFIG_FILE`` is set, will look for the file
in the specified location.
Configuration options
+++++++++++++++++++++
Django group
------------
The first part of the configuration file contains standard Django settings,
and for the most part the generated example config will explain all the
options.
Identity group
--------------
Are the configs for how Adjutant interacts with Keystone, with the important
ones being as follows:
**adjutant.identity.username_is_email** impacts account creation, and email
modification actions. In the case that it is true, any task passing a username
and email pair, the username will be ignored. This also impacts where emails
are sent to.
**adjutant.identity.auth** Are the credentials that Adjutant uses to talk to
Keystone, and the various other OpenStack services.
**adjutant.identity.role_mapping** defines which roles can modify other roles.
In the default configuration a user who has the role project_mod will not be
able to modify any of the roles for a user with the project_admin role.
API group
---------
Controls which DelegateAPIs are enabled, and what some of their configuration
may be.
Notifications group
-------------------
Default settings around what notifications should do during the task workflows.
Workflow group
--------------
**adjutant.workflow.task_defaults** Represents the default settings for all
tasks unless otherwise overridden for individual tasks in
``adjutant.workflow.tasks``.
Default action settings.
**adjutant.workflow.action_defaults** Are the default settings for each action
and can be overriden on a per task basis via
``adjutant.workflow.tasks.<my_task>.actions``.
Email and notification templates
++++++++++++++++++++++++++++++++
Additional templates can be placed in ``/etc/adjutant/templates/`` and will be
loaded in automatically. A plain text template and an HTML template can be
specified separately. The context for this will include the task object and
a dictionary containing the action objects.