From 821f0dd1c50815c794df9f9e71a6ef5a09536b4e Mon Sep 17 00:00:00 2001 From: ZhiQiang Fan Date: Mon, 9 May 2016 23:40:35 +0800 Subject: [PATCH] generate latest sample config file along with document Currently, when users want to get the sample config file, they need to install many development tools such as git, tox and etc, then run `tox -egenconfig` to get it. oslo_config provides a tool named sphinxconfiggen since version 2.3.0, which enables us generate the sample config file along with document. Also the OpenStack Manual Configuration Reference doesn't have sample config file for master branch, the stable branches need to be improved as well, so this paragraph is removed. Change-Id: Ie61beef490618f18a711e789cb1ac006b85b8f0a --- .gitignore | 1 + doc/source/conf.py | 6 ++++- doc/source/configuration.rst | 43 ++++++++++++++++++++++-------------- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 96bfa5228..ba95f56b6 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ cover/* dist/* doc/build doc/source/api/ +doc/source/_static/ etc/aodh/aodh.conf subunit.log diff --git a/doc/source/conf.py b/doc/source/conf.py index 353c11469..6301a15e1 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -48,8 +48,12 @@ extensions = [ 'sphinxcontrib.pecanwsme.rest', 'oslosphinx', 'stevedore.sphinxext', + 'oslo_config.sphinxconfiggen', ] +config_generator_config_file = os.path.join(ROOT, 'etc/aodh/aodh-config-generator.conf') +sample_config_basename = '_static/aodh' + wsme_protocols = ['restjson', 'restxml'] todo_include_todos = True @@ -148,7 +152,7 @@ html_theme_options = { # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = ['_static'] +html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index a78856396..6cb9bc33c 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -18,23 +18,6 @@ Configuration ============= -Configure Aodh by editing `/etc/aodh/aodh.conf`. - -No config file is provided with the source code, but one can be easily created -by running: - -:: - - tox -e genconfig - -This command will create an `etc/aodh/aodh.conf` file which can be used as a -base for the default configuration file at `/etc/aodh/aodh.conf`. - -For the list and description of configuration options that can be set for Aodh in -order to set up the services please see the -`Telemetry section `_ -in the OpenStack Manuals Configuration Reference. - HBase =================== @@ -74,3 +57,29 @@ To find out more about supported storage backends please take a look on the services. .. _Apache: https://hbase.apache.org/book/quickstart.html + + +Aodh Sample Configuration File +============================== + +Configure Aodh by editing /etc/aodh/aodh.conf. + +No config file is provided with the source code, it will be created during +the installation. In case where no configuration file was installed, one +can be easily created by running:: + + oslo-config-generator --config-file=/etc/aodh/aodh-config-generator.conf \ + --output-file=/etc/aodh/aodh.conf + +The following is a sample Aodh configuration for adaptation and use. It is +auto-generated from Aodh when this documentation is built, and can also be +viewed in `file form <_static/aodh.conf.sample>`_. + +.. note:: + + As a developer, with full development tools, you can create a sample + configuration file from any branch or commit. Just checkout to that + branch or commit, run ``tox -e genconfig``, then `etc/aodh/aodh.conf` + will be generated. + +.. literalinclude:: _static/aodh.conf.sample