Backend Drivers

Refer to oslo_config.sources

Known Backend Drivers

Remote File

The remote_file backend driver is the first driver implemented by oslo.config. It extends the previous limit of only accessing local files to a new scenario where it is possible to access configuration data over the network. The remote_file driver is based on the requests module and is capable of accessing remote files through HTTP or HTTPS.

To definition of a remote_file configuration data source can be as minimal as:

[DEFAULT]
config_source = external_config_group

[external_config_group]
driver = remote_file
uri = http://mydomain.com/path/to/config/data.conf

Or as complete as:

[DEFAULT]
config_source = external_config_group

[external_config_group]
driver = remote_file
uri = https://mydomain.com/path/to/config/data.conf
ca_path = /path/to/server/ca.pem
client_key = /path/to/my/key.pem
client_cert = /path/to/my/cert.pem

On the following sessions, you can find more information about this driver’s classes and its options.

The Driver Class

class oslo_config.sources._uri.URIConfigurationSourceDriver

A backend driver for remote files served through http[s].

Required options:
  • uri: URI containing the file location.

Non-required options:
  • ca_path: The path to a CA_BUNDLE file or directory with

    certificates of trusted CAs.

  • client_cert: Client side certificate, as a single file path

    containing either the certificate only or the private key and the certificate.

  • client_key: Client side private key, in case client_cert is

    specified but does not includes the private key.

The Configuration Source Class

class oslo_config.sources._uri.URIConfigurationSource(uri, ca_path=None, client_cert=None, client_key=None)

A configuration source for remote files served through http[s].

Parameters
  • uri – The Uniform Resource Identifier of the configuration to be retrieved.

  • ca_path – The path to a CA_BUNDLE file or directory with certificates of trusted CAs.

  • client_cert – Client side certificate, as a single file path containing either the certificate only or the private key and the certificate.

  • client_key – Client side private key, in case client_cert is specified but does not includes the private key.

Environment

The environment backend driver provides a method of accessing configuration data in environment variables. It is enabled by default and requires no additional configuration to use. The environment is checked after command line options, but before configuration files.

Environment variables are checked for any configuration data. The variable names take the form:

  • A prefix of OS_

  • The group name, uppercased

  • Separated from the option name by a __ (double underscore)

  • Followed by the name

For an option that looks like this in the usual INI format:

[placement_database]
connection = sqlite:///

the corresponding environment variable would be OS_PLACEMENT_DATABASE__CONNECTION.

The Driver Class

class oslo_config.sources._environment.EnvironmentConfigurationSourceDriver

A backend driver for environment variables.

This configuration source is available by default and does not need special configuration to use. The sample config is generated automatically but is not necessary.

The Configuration Source Class

class oslo_config.sources._environment.EnvironmentConfigurationSource

A configuration source for options in the environment.