Add dynamic table for our tested Scenarios
This change adds in a dynamic table to our documentation so that we're able to generate a table of all available scenarios and mark where services are tested within. To make the dynamic scenario generation easier the AIO scenario conf setup has been moved into it's own variable file. The file doc/source/contributor/scenario-table-gen.html has been touched allowing sphinx to import and generate the required table as needed. Change-Id: Ief5d180491d3a330890d6bfa06d43f565dd26103 Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
33836d3d5e
commit
fdf33902c2
@ -22,10 +22,22 @@
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import imp
|
||||
import os
|
||||
import pbr.version
|
||||
import sys
|
||||
|
||||
# Create dynamic table file.
|
||||
CONF_PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
SCENARIO_TABLE = 'contributor/scenario-table-gen.html'
|
||||
TABLE_FILE = os.path.join(CONF_PATH, SCENARIO_TABLE)
|
||||
stg = imp.load_source(
|
||||
'scenario_table_gen',
|
||||
os.path.join(CONF_PATH, 'scenario_table_gen.py')
|
||||
)
|
||||
with open(TABLE_FILE, 'a+') as f:
|
||||
f.write(stg.main())
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
|
@ -183,6 +183,12 @@ execute the following:
|
||||
# export SCENARIO='ceph'
|
||||
# scripts/bootstrap-aio.sh
|
||||
|
||||
**Tested Scenarios**
|
||||
|
||||
.. raw:: html
|
||||
:file: scenario-table-gen.html
|
||||
|
||||
|
||||
To add OpenStack Services over and above the `bootstrap-aio default services`_
|
||||
for the applicable scenario, copy the ``conf.d`` files with the ``.aio`` file
|
||||
extension into ``/etc/openstack_deploy`` and rename then to ``.yml`` files.
|
||||
|
0
doc/source/contributor/scenario-table-gen.html
Normal file
0
doc/source/contributor/scenario-table-gen.html
Normal file
69
doc/source/scenario_table_gen.py
Normal file
69
doc/source/scenario_table_gen.py
Normal file
@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2017, Rackspace US, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import os
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
SCENARIO_FILE = '../../tests/vars/bootstrap-aio-vars.yml'
|
||||
HTML_TABLE = """<html><table border="1">"""
|
||||
|
||||
|
||||
def main():
|
||||
scenario_file = os.path.join(SCRIPT_PATH, SCENARIO_FILE)
|
||||
with open(scenario_file) as f:
|
||||
_meta_data = yaml.safe_load(f.read())
|
||||
|
||||
scenario_meta_data = _meta_data['confd_overrides']
|
||||
scenarios = list(sorted(scenario_meta_data.keys()))
|
||||
scenarios.insert(0, '')
|
||||
HTML_TABLE = '<table border="1">'
|
||||
HTML_TABLE += '<thead valign="bottom"><tr>'
|
||||
for s in scenarios:
|
||||
HTML_TABLE += '<th style="padding-left:5px;padding-right:5px;" class="head">{}</th>'.format(s)
|
||||
HTML_TABLE += '</tr></thead><tbody valign="top">'
|
||||
|
||||
config_items = set()
|
||||
for items in scenario_meta_data.values():
|
||||
for item in items:
|
||||
config_items.add(item['name'].split('.')[0])
|
||||
config_items = list(config_items)
|
||||
|
||||
for item in config_items:
|
||||
HTML_TABLE += '<tr>'
|
||||
HTML_TABLE += '<td align="left">{}</td>'.format(item.lower())
|
||||
for scenario in scenarios:
|
||||
try:
|
||||
scenario_meta = scenario_meta_data[scenario]
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
for _items in scenario_meta:
|
||||
if item == _items['name'].split('.')[0]:
|
||||
HTML_TABLE += '<td align="center">X</td>'
|
||||
break
|
||||
else:
|
||||
HTML_TABLE += '<td> </td>'
|
||||
HTML_TABLE += '</tr>'
|
||||
HTML_TABLE += '</tbody>'
|
||||
HTML_TABLE += '</table>'
|
||||
|
||||
return HTML_TABLE
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(main())
|
@ -23,52 +23,8 @@
|
||||
- role: "bootstrap-host"
|
||||
vars:
|
||||
ansible_python_interpreter: "/usr/bin/python"
|
||||
openstack_confd_entries: "{{ confd_overrides[bootstrap_host_scenario] }}"
|
||||
bootstrap_host_scenario: "{{ lookup('env','SCENARIO') | default('aio', true) }}"
|
||||
confd_overrides:
|
||||
aio:
|
||||
- name: cinder.yml.aio
|
||||
- name: designate.yml.aio
|
||||
- name: glance.yml.aio
|
||||
- name: heat.yml.aio
|
||||
- name: horizon.yml.aio
|
||||
- name: keystone.yml.aio
|
||||
- name: neutron.yml.aio
|
||||
- name: nova.yml.aio
|
||||
- name: swift.yml.aio
|
||||
ceph:
|
||||
- name: ceph.yml.aio
|
||||
- name: cinder.yml.aio
|
||||
- name: glance.yml.aio
|
||||
- name: heat.yml.aio
|
||||
- name: horizon.yml.aio
|
||||
- name: keystone.yml.aio
|
||||
- name: neutron.yml.aio
|
||||
- name: nova.yml.aio
|
||||
translations:
|
||||
- name: cinder.yml.aio
|
||||
- name: designate.yml.aio
|
||||
- name: glance.yml.aio
|
||||
- name: heat.yml.aio
|
||||
- name: horizon.yml.aio
|
||||
- name: keystone.yml.aio
|
||||
- name: neutron.yml.aio
|
||||
- name: nova.yml.aio
|
||||
- name: swift.yml.aio
|
||||
- name: sahara.yml.aio
|
||||
- name: magnum.yml.aio
|
||||
- name: octavia.yml.aio
|
||||
- name: trove.yml.aio
|
||||
octavia:
|
||||
- name: glance.yml.aio
|
||||
- name: keystone.yml.aio
|
||||
- name: neutron.yml.aio
|
||||
- name: nova.yml.aio
|
||||
- name: octavia.yml.aio
|
||||
tacker:
|
||||
- name: keystone.yml.aio
|
||||
- name: heat.yml.aio
|
||||
- name: tacker.yml.aio
|
||||
openstack_confd_entries: "{{ confd_overrides[bootstrap_host_scenario] }}"
|
||||
pip_install_upper_constraints_proto: "{{ ansible_python_version | version_compare('2.7.9', '>=') | ternary('https','http') }}"
|
||||
sftp_subsystem:
|
||||
'apt': 'sftp /usr/lib/openssh/sftp-server'
|
||||
@ -117,4 +73,5 @@
|
||||
GSSAPICleanupCredentials: no
|
||||
vars_files:
|
||||
- "{{ playbook_dir }}/../playbooks/defaults/repo_packages/openstack_services.yml"
|
||||
- vars/bootstrap-aio-vars.yml
|
||||
environment: "{{ deployment_environment_variables | default({}) }}"
|
||||
|
59
tests/vars/bootstrap-aio-vars.yml
Normal file
59
tests/vars/bootstrap-aio-vars.yml
Normal file
@ -0,0 +1,59 @@
|
||||
---
|
||||
# Copyright 2017, Rackspace US, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
confd_overrides:
|
||||
aio:
|
||||
- name: cinder.yml.aio
|
||||
- name: designate.yml.aio
|
||||
- name: glance.yml.aio
|
||||
- name: heat.yml.aio
|
||||
- name: horizon.yml.aio
|
||||
- name: keystone.yml.aio
|
||||
- name: neutron.yml.aio
|
||||
- name: nova.yml.aio
|
||||
- name: swift.yml.aio
|
||||
ceph:
|
||||
- name: ceph.yml.aio
|
||||
- name: cinder.yml.aio
|
||||
- name: glance.yml.aio
|
||||
- name: heat.yml.aio
|
||||
- name: horizon.yml.aio
|
||||
- name: keystone.yml.aio
|
||||
- name: neutron.yml.aio
|
||||
- name: nova.yml.aio
|
||||
translations:
|
||||
- name: cinder.yml.aio
|
||||
- name: designate.yml.aio
|
||||
- name: glance.yml.aio
|
||||
- name: heat.yml.aio
|
||||
- name: horizon.yml.aio
|
||||
- name: keystone.yml.aio
|
||||
- name: neutron.yml.aio
|
||||
- name: nova.yml.aio
|
||||
- name: swift.yml.aio
|
||||
- name: sahara.yml.aio
|
||||
- name: magnum.yml.aio
|
||||
- name: octavia.yml.aio
|
||||
- name: trove.yml.aio
|
||||
octavia:
|
||||
- name: glance.yml.aio
|
||||
- name: keystone.yml.aio
|
||||
- name: neutron.yml.aio
|
||||
- name: nova.yml.aio
|
||||
- name: octavia.yml.aio
|
||||
tacker:
|
||||
- name: keystone.yml.aio
|
||||
- name: heat.yml.aio
|
||||
- name: tacker.yml.aio
|
Loading…
Reference in New Issue
Block a user