diff --git a/doc/source/admin/run_trove_in_production.rst b/doc/source/admin/run_trove_in_production.rst index a57f62ebd3..5750680c5e 100644 --- a/doc/source/admin/run_trove_in_production.rst +++ b/doc/source/admin/run_trove_in_production.rst @@ -150,8 +150,16 @@ guest instance doesn't affect other instances nor other cloud users. Configuring Trove ~~~~~~~~~~~~~~~~~ -The default Trove configuration file location is ``/etc/trove/trove.conf``. The -typical config options (not a full list) are: +The default Trove configuration file location is ``/etc/trove/trove.conf``. You +can generate a sample config file by running: + +.. code-block:: console + + cd + pip install -e . + oslo-config-generator --namespace trove.config --namespace oslo.messaging --namespace oslo.log --namespace oslo.log oslo.policy --output-file /etc/trove/trove.conf.sample + +The typical config options (not a full list) are: DEFAULT group enable_secure_rpc_messaging diff --git a/setup.cfg b/setup.cfg index 1b5085d0e5..8344f15f5d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,3 +58,6 @@ oslo.policy.policies = # list_rules method into a separate entry point rather than using the # aggregate method. trove = trove.common.policies:list_rules + +oslo.config.opts = + trove.config = trove.common.cfg:list_opts diff --git a/trove/common/cfg.py b/trove/common/cfg.py index e1f233b611..9afb58b3b8 100644 --- a/trove/common/cfg.py +++ b/trove/common/cfg.py @@ -17,9 +17,11 @@ import os.path +from keystoneauth1 import loading +from keystonemiddleware import auth_token from oslo_config import cfg -from oslo_config.cfg import NoSuchOptError from oslo_config import types +from oslo_config.cfg import NoSuchOptError from oslo_log import log as logging from oslo_middleware import cors from osprofiler import opts as profiler @@ -1470,6 +1472,24 @@ profiler.set_defaults(CONF) logging.register_options(CONF) +def list_opts(): + keystone_middleware_opts = auth_token.list_opts() + keystone_loading_opts = [( + 'keystone_authtoken', loading.get_auth_plugin_conf_options('password') + )] + + trove_opts = [ + (None, path_opts + versions_opts + common_opts), + ('database', database_opts), + (mysql_group, mysql_opts), + (mariadb_group, mariadb_opts), + (network_group, network_opts), + (service_credentials_group, service_credentials_opts), + ] + + return keystone_middleware_opts + keystone_loading_opts + trove_opts + + def custom_parser(parsername, parser): CONF.register_cli_opt(cfg.SubCommandOpt(parsername, handler=parser))