diff --git a/doc/source/_exts/ansible-autodoc.py b/doc/source/_exts/ansible-autodoc.py new file mode 100644 index 000000000..02c78038e --- /dev/null +++ b/doc/source/_exts/ansible-autodoc.py @@ -0,0 +1,325 @@ +# Copyright 2019 Red Hat, Inc. +# All Rights Reserved. +# +# 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 imp +import os + +from docutils import core +from docutils import nodes +from docutils.parsers.rst import Directive +from docutils.parsers import rst +from docutils.writers.html4css1 import Writer + +import yaml + + +class AnsibleAutoPluginDirective(Directive): + directive_name = "ansibleautoplugin" + has_content = True + option_spec = { + 'module': rst.directives.unchanged, + 'role': rst.directives.unchanged, + 'documentation': rst.directives.unchanged, + 'examples': rst.directives.unchanged + } + + @staticmethod + def _render_html(source): + return core.publish_parts( + source=source, + writer=Writer(), + writer_name='html', + settings_overrides={'no_system_messages': True} + ) + + def make_node(self, title, contents, content_type=None): + section = self._section_block(title=title) + if not content_type: + # Doc section + for content in contents['docs']: + for paragraph in content.split('\n'): + retnode = nodes.paragraph() + retnode.append(self._raw_html_block(data=paragraph)) + section.append(retnode) + + # Options Section + options_list = nodes.field_list() + options_section = self._section_block(title='Options') + for key, value in contents['options'].items(): + options_list.append( + self._raw_fields( + data=value['description'], + field_name=key + ) + ) + else: + options_section.append(options_list) + section.append(options_section) + + # Authors Section + authors_list = nodes.field_list() + authors_list.append( + self._raw_fields( + data=contents['author'] + ) + ) + authors_section = self._section_block(title='Authors') + authors_section.append(authors_list) + section.append(authors_section) + + elif content_type == 'yaml': + for content in contents: + section.append( + self._literal_block( + data=content, + dump_data=False + ) + ) + + return section + + @staticmethod + def load_module(filename): + return imp.load_source('__ansible_module__', filename) + + @staticmethod + def build_documentation(module): + docs = yaml.safe_load(module.DOCUMENTATION) + doc_data = dict() + doc_data['docs'] = docs['description'] + doc_data['author'] = docs.get('author', list()) + doc_data['options'] = docs.get('options', dict()) + return doc_data + + @staticmethod + def build_examples(module): + examples = yaml.safe_load(module.EXAMPLES) + return_examples = list() + for example in examples: + return_examples.append( + yaml.safe_dump([example], default_flow_style=False) + ) + return return_examples + + def _raw_html_block(self, data): + html = self._render_html(source=data) + return nodes.raw('', html['body'], format='html') + + def _raw_fields(self, data, field_name=''): + body = nodes.field_body() + if isinstance(data, list): + for item in data: + body.append(self._raw_html_block(data=item)) + else: + body.append(self._raw_html_block(data=data)) + + field = nodes.field() + field.append(nodes.field_name(text=field_name)) + field.append(body) + return field + + @staticmethod + def _literal_block(data, language='yaml', dump_data=True): + if dump_data: + literal = nodes.literal_block( + text=yaml.safe_dump( + data, + default_flow_style=False + ) + ) + else: + literal = nodes.literal_block(text=data) + literal['language'] = 'yaml' + return literal + + @staticmethod + def _section_block(title, text=None): + section = nodes.section( + title, + nodes.title(text=title), + ids=[nodes.make_id('-'.join(title))], + ) + if text: + section_body = nodes.field_body() + section_body.append(nodes.paragraph(text=text)) + section.append(section_body) + + return section + + def _yaml_section(self, to_yaml_data, section_title, section_text=None): + yaml_section = self._section_block( + title=section_title, + text=section_text + ) + yaml_section.append(self._literal_block(data=to_yaml_data)) + return yaml_section + + def _run_role(self, role): + section = self._section_block( + title='Role Documentation', + text='Welcome to the "{}" role documentation.'.format( + os.path.basename(role) + ) + ) + defaults_file = os.path.join(role, 'defaults', 'main.yml') + if os.path.exists(defaults_file): + with open(defaults_file) as f: + role_defaults = yaml.safe_load(f.read()) + section.append( + self._yaml_section( + to_yaml_data=role_defaults, + section_title='Role Defaults', + section_text='This section highlights all of the defaults' + ' and variables set within the "{}"' + ' role.'.format( + os.path.basename(role) + ) + ) + ) + + vars_path = os.path.join(role, 'vars') + if os.path.exists(vars_path): + for v_file in os.listdir(vars_path): + vars_file = os.path.join(vars_path, v_file) + with open(vars_file) as f: + vars_values = yaml.safe_load(f.read()) + section.append( + self._yaml_section( + to_yaml_data=vars_values, + section_title='Role Variables: {}'.format(v_file) + ) + ) + + test_section = self._section_block( + title='Molecule Scenarios', + text='Molecule is being used to test the "{}" role. The' + ' following section highlights the drivers in service' + ' and provides an example playbook showing how the role' + ' is leveraged.'.format( + os.path.basename(role) + ) + ) + molecule_path = os.path.join(role, 'molecule') + if os.path.exists(molecule_path): + for test in os.listdir(molecule_path): + molecule_section = self._section_block( + title='Scenario: {}'.format(test) + ) + molecule_file = os.path.join( + molecule_path, + test, + 'molecule.yml' + ) + with open(molecule_file) as f: + molecule_conf = yaml.safe_load(f.read()) + + molecule_section.append( + self._yaml_section( + to_yaml_data=molecule_conf, + section_title='Example {} configuration'.format(test) + ) + ) + + provisioner_data = molecule_conf.get('provisioner') + if provisioner_data: + inventory = provisioner_data.get('inventory') + if inventory: + molecule_section.append( + self._yaml_section( + to_yaml_data=inventory, + section_title='Molecule Inventory' + ) + ) + + molecule_playbook_path = os.path.join( + molecule_path, + test, + 'playbook.yml' + ) + with open(molecule_playbook_path) as f: + molecule_playbook = yaml.safe_load(f.read()) + molecule_section.append( + self._yaml_section( + to_yaml_data=molecule_playbook, + section_title='Example {} playbook'.format(test) + ) + ) + test_section.append(molecule_section) + else: + section.append(test_section) + + self.run_returns.append(section) + + # Document any libraries nested within the role + library_path = os.path.join(role, 'library') + if os.path.exists(library_path): + self.options['documentation'] = True + self.options['examples'] = True + for lib in os.listdir(library_path): + if lib.endswith('.py'): + self._run_module( + module=self.load_module( + filename=os.path.join( + library_path, + lib + ) + ), + module_title='Embedded module: {}'.format(lib), + example_title='Examples for embedded module' + ) + + def _run_module(self, module, module_title="Module Documentation", + example_title="Example Tasks"): + if self.options.get('documentation'): + docs = self.build_documentation(module=module) + self.run_returns.append( + self.make_node( + title=module_title, + contents=docs + ) + ) + + if self.options.get('examples'): + examples = self.build_examples(module=module) + self.run_returns.append( + self.make_node( + title=example_title, + contents=examples, + content_type='yaml' + ) + ) + + def run(self): + self.run_returns = list() + + if self.options.get('module'): + module = self.load_module(filename=self.options['module']) + self._run_module(module=module) + + if self.options.get('role'): + self._run_role(role=self.options['role']) + + return self.run_returns + + +def setup(app): + classes = [ + AnsibleAutoPluginDirective, + ] + for directive_class in classes: + app.add_directive(directive_class.directive_name, directive_class) + + return {'version': '0.2'} diff --git a/doc/source/_exts/generate_validations_doc.py b/doc/source/_exts/generate_validations_doc.py index b5826632f..467aa8cdc 100644 --- a/doc/source/_exts/generate_validations_doc.py +++ b/doc/source/_exts/generate_validations_doc.py @@ -87,8 +87,9 @@ def build_detail(group, validations): - **parameters**: {parameters} - **roles**: {roles} -`View source code for the role `__. +.. toctree:: + roles/role-{roles} """ .format(label=(group + '_' + validation['id']), title=validation['id'], diff --git a/doc/source/conf.py b/doc/source/conf.py index 165f31f75..2c99f0ba2 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -27,6 +27,7 @@ sys.path.insert(0, os.path.join(os.path.abspath('.'), '_exts')) extensions = [ 'sphinx.ext.autodoc', 'generate_validations_doc', + 'ansible-autodoc', 'openstackdocstheme' ] @@ -41,7 +42,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -copyright = u'2016, OpenStack Foundation' +copyright = u'2019, OpenStack Foundation' # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True @@ -72,9 +73,6 @@ latex_documents = [ u'OpenStack Foundation', 'manual'), ] -# Example configuration for intersphinx: refer to the Python standard library. -#intersphinx_mapping = {'http://docs.python.org/': None} - # openstackdocstheme options repository_name = 'openstack/tripleo-validations' bug_project = 'tripleo' diff --git a/doc/source/index.rst b/doc/source/index.rst index 92bd899df..4f04afa29 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -15,6 +15,8 @@ Contents: installation usage contributing + roles + modules Existing validations: diff --git a/doc/source/modules.rst b/doc/source/modules.rst new file mode 100644 index 000000000..c5d2bf657 --- /dev/null +++ b/doc/source/modules.rst @@ -0,0 +1,10 @@ +Documented modules in TripleO-Validations +========================================= + +Contents: + +.. toctree:: + :glob: + + modules/* + diff --git a/doc/source/modules/modules-advanced_format.rst b/doc/source/modules/modules-advanced_format.rst new file mode 100644 index 000000000..cf900ba13 --- /dev/null +++ b/doc/source/modules/modules-advanced_format.rst @@ -0,0 +1,15 @@ +======================== +Module - advanced_format +======================== + + +This module provides for the following ansible plugin: + + * advanced_format + + +.. ansibleautoplugin:: + :module: library/advanced_format.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-check_flavors.rst b/doc/source/modules/modules-check_flavors.rst new file mode 100644 index 000000000..94f1b92fc --- /dev/null +++ b/doc/source/modules/modules-check_flavors.rst @@ -0,0 +1,15 @@ +====================== +Module - check_flavors +====================== + + +This module provides for the following ansible plugin: + + * check_flavors + + +.. ansibleautoplugin:: + :module: library/check_flavors.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-check_ironic_boot_config.rst b/doc/source/modules/modules-check_ironic_boot_config.rst new file mode 100644 index 000000000..5f3a7aa64 --- /dev/null +++ b/doc/source/modules/modules-check_ironic_boot_config.rst @@ -0,0 +1,15 @@ +================================= +Module - check_ironic_boot_config +================================= + + +This module provides for the following ansible plugin: + + * check_ironic_boot_config + + +.. ansibleautoplugin:: + :module: library/check_ironic_boot_config.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-check_package_update.rst b/doc/source/modules/modules-check_package_update.rst new file mode 100644 index 000000000..1d7994394 --- /dev/null +++ b/doc/source/modules/modules-check_package_update.rst @@ -0,0 +1,15 @@ +============================= +Module - check_package_update +============================= + + +This module provides for the following ansible plugin: + + * check_package_update + + +.. ansibleautoplugin:: + :module: library/check_package_update.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-docker_facts.rst b/doc/source/modules/modules-docker_facts.rst new file mode 100644 index 000000000..840fb81ed --- /dev/null +++ b/doc/source/modules/modules-docker_facts.rst @@ -0,0 +1,15 @@ +===================== +Module - docker_facts +===================== + + +This module provides for the following ansible plugin: + + * docker_facts + + +.. ansibleautoplugin:: + :module: library/docker_facts.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-haproxy_conf.rst b/doc/source/modules/modules-haproxy_conf.rst new file mode 100644 index 000000000..8f2bab36e --- /dev/null +++ b/doc/source/modules/modules-haproxy_conf.rst @@ -0,0 +1,15 @@ +===================== +Module - haproxy_conf +===================== + + +This module provides for the following ansible plugin: + + * haproxy_conf + + +.. ansibleautoplugin:: + :module: library/haproxy_conf.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-hiera.rst b/doc/source/modules/modules-hiera.rst new file mode 100644 index 000000000..f9acdf83e --- /dev/null +++ b/doc/source/modules/modules-hiera.rst @@ -0,0 +1,15 @@ +============== +Module - hiera +============== + + +This module provides for the following ansible plugin: + + * hiera + + +.. ansibleautoplugin:: + :module: library/hiera.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-icmp_ping.rst b/doc/source/modules/modules-icmp_ping.rst new file mode 100644 index 000000000..f849f9605 --- /dev/null +++ b/doc/source/modules/modules-icmp_ping.rst @@ -0,0 +1,15 @@ +================== +Module - icmp_ping +================== + + +This module provides for the following ansible plugin: + + * icmp_ping + + +.. ansibleautoplugin:: + :module: library/icmp_ping.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-ini.rst b/doc/source/modules/modules-ini.rst new file mode 100644 index 000000000..453bb62b4 --- /dev/null +++ b/doc/source/modules/modules-ini.rst @@ -0,0 +1,15 @@ +============ +Module - ini +============ + + +This module provides for the following ansible plugin: + + * ini + + +.. ansibleautoplugin:: + :module: library/ini.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-ip_range.rst b/doc/source/modules/modules-ip_range.rst new file mode 100644 index 000000000..eac4ab4cb --- /dev/null +++ b/doc/source/modules/modules-ip_range.rst @@ -0,0 +1,15 @@ +================= +Module - ip_range +================= + + +This module provides for the following ansible plugin: + + * ip_range + + +.. ansibleautoplugin:: + :module: library/ip_range.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-network_environment.rst b/doc/source/modules/modules-network_environment.rst new file mode 100644 index 000000000..d779a4065 --- /dev/null +++ b/doc/source/modules/modules-network_environment.rst @@ -0,0 +1,15 @@ +============================ +Module - network_environment +============================ + + +This module provides for the following ansible plugin: + + * network_environment + + +.. ansibleautoplugin:: + :module: library/network_environment.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-node_disks.rst b/doc/source/modules/modules-node_disks.rst new file mode 100644 index 000000000..098efb65c --- /dev/null +++ b/doc/source/modules/modules-node_disks.rst @@ -0,0 +1,15 @@ +=================== +Module - node_disks +=================== + + +This module provides for the following ansible plugin: + + * node_disks + + +.. ansibleautoplugin:: + :module: library/node_disks.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-overcloudrc.rst b/doc/source/modules/modules-overcloudrc.rst new file mode 100644 index 000000000..10ab9a9cb --- /dev/null +++ b/doc/source/modules/modules-overcloudrc.rst @@ -0,0 +1,15 @@ +==================== +Module - overcloudrc +==================== + + +This module provides for the following ansible plugin: + + * overcloudrc + + +.. ansibleautoplugin:: + :module: library/overcloudrc.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-ovs_dpdk_pmd_cpus_check.rst b/doc/source/modules/modules-ovs_dpdk_pmd_cpus_check.rst new file mode 100644 index 000000000..b34a76429 --- /dev/null +++ b/doc/source/modules/modules-ovs_dpdk_pmd_cpus_check.rst @@ -0,0 +1,15 @@ +================================ +Module - ovs_dpdk_pmd_cpus_check +================================ + + +This module provides for the following ansible plugin: + + * ovs_dpdk_pmd_cpus_check + + +.. ansibleautoplugin:: + :module: library/ovs_dpdk_pmd_cpus_check.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-pacemaker.rst b/doc/source/modules/modules-pacemaker.rst new file mode 100644 index 000000000..f861b171d --- /dev/null +++ b/doc/source/modules/modules-pacemaker.rst @@ -0,0 +1,15 @@ +================== +Module - pacemaker +================== + + +This module provides for the following ansible plugin: + + * pacemaker + + +.. ansibleautoplugin:: + :module: library/pacemaker.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-switch_vlans.rst b/doc/source/modules/modules-switch_vlans.rst new file mode 100644 index 000000000..1566db33b --- /dev/null +++ b/doc/source/modules/modules-switch_vlans.rst @@ -0,0 +1,15 @@ +===================== +Module - switch_vlans +===================== + + +This module provides for the following ansible plugin: + + * switch_vlans + + +.. ansibleautoplugin:: + :module: library/switch_vlans.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-verify_profiles.rst b/doc/source/modules/modules-verify_profiles.rst new file mode 100644 index 000000000..509e969b9 --- /dev/null +++ b/doc/source/modules/modules-verify_profiles.rst @@ -0,0 +1,15 @@ +======================== +Module - verify_profiles +======================== + + +This module provides for the following ansible plugin: + + * verify_profiles + + +.. ansibleautoplugin:: + :module: library/verify_profiles.py + :documentation: true + :examples: true + diff --git a/doc/source/modules/modules-warn.rst b/doc/source/modules/modules-warn.rst new file mode 100644 index 000000000..4ad6391b9 --- /dev/null +++ b/doc/source/modules/modules-warn.rst @@ -0,0 +1,15 @@ +============= +Module - warn +============= + + +This module provides for the following ansible plugin: + + * warn + + +.. ansibleautoplugin:: + :module: library/warn.py + :documentation: true + :examples: true + diff --git a/doc/source/roles.rst b/doc/source/roles.rst new file mode 100644 index 000000000..6a414fc87 --- /dev/null +++ b/doc/source/roles.rst @@ -0,0 +1,10 @@ +Documented roles in TripleO-Validations +======================================= + +Contents: + +.. toctree:: + :glob: + + roles/* + diff --git a/doc/source/roles/role-advanced-format-512e-support.rst b/doc/source/roles/role-advanced-format-512e-support.rst new file mode 100644 index 000000000..65a878b47 --- /dev/null +++ b/doc/source/roles/role-advanced-format-512e-support.rst @@ -0,0 +1,7 @@ +============================ +advanced-format-512e-support +============================ + +.. ansibleautoplugin:: + :role: roles/advanced-format-512e-support + diff --git a/doc/source/roles/role-ceilometerdb-size.rst b/doc/source/roles/role-ceilometerdb-size.rst new file mode 100644 index 000000000..80884c2e6 --- /dev/null +++ b/doc/source/roles/role-ceilometerdb-size.rst @@ -0,0 +1,7 @@ +================= +ceilometerdb-size +================= + +.. ansibleautoplugin:: + :role: roles/ceilometerdb-size + diff --git a/doc/source/roles/role-ceph.rst b/doc/source/roles/role-ceph.rst new file mode 100644 index 000000000..aeb1530d8 --- /dev/null +++ b/doc/source/roles/role-ceph.rst @@ -0,0 +1,7 @@ +==== +ceph +==== + +.. ansibleautoplugin:: + :role: roles/ceph + diff --git a/doc/source/roles/role-check-latest-minor-version.rst b/doc/source/roles/role-check-latest-minor-version.rst new file mode 100644 index 000000000..b671b56b3 --- /dev/null +++ b/doc/source/roles/role-check-latest-minor-version.rst @@ -0,0 +1,7 @@ +========================== +check-latest-minor-version +========================== + +.. ansibleautoplugin:: + :role: roles/check-latest-minor-version + diff --git a/doc/source/roles/role-check-network-gateway.rst b/doc/source/roles/role-check-network-gateway.rst new file mode 100644 index 000000000..d9dbf86ee --- /dev/null +++ b/doc/source/roles/role-check-network-gateway.rst @@ -0,0 +1,7 @@ +===================== +check-network-gateway +===================== + +.. ansibleautoplugin:: + :role: roles/check-network-gateway + diff --git a/doc/source/roles/role-collect-flavors-and-verify-profiles.rst b/doc/source/roles/role-collect-flavors-and-verify-profiles.rst new file mode 100644 index 000000000..0c9b6b30e --- /dev/null +++ b/doc/source/roles/role-collect-flavors-and-verify-profiles.rst @@ -0,0 +1,7 @@ +=================================== +collect-flavors-and-verify-profiles +=================================== + +.. ansibleautoplugin:: + :role: roles/collect-flavors-and-verify-profiles + diff --git a/doc/source/roles/role-containerized-undercloud-docker.rst b/doc/source/roles/role-containerized-undercloud-docker.rst new file mode 100644 index 000000000..b2efe2997 --- /dev/null +++ b/doc/source/roles/role-containerized-undercloud-docker.rst @@ -0,0 +1,7 @@ +=============================== +containerized-undercloud-docker +=============================== + +.. ansibleautoplugin:: + :role: roles/containerized-undercloud-docker + diff --git a/doc/source/roles/role-controller-token.rst b/doc/source/roles/role-controller-token.rst new file mode 100644 index 000000000..6c0eb04a3 --- /dev/null +++ b/doc/source/roles/role-controller-token.rst @@ -0,0 +1,7 @@ +================ +controller-token +================ + +.. ansibleautoplugin:: + :role: roles/controller-token + diff --git a/doc/source/roles/role-controller-ulimits.rst b/doc/source/roles/role-controller-ulimits.rst new file mode 100644 index 000000000..17f42bac8 --- /dev/null +++ b/doc/source/roles/role-controller-ulimits.rst @@ -0,0 +1,7 @@ +================== +controller-ulimits +================== + +.. ansibleautoplugin:: + :role: roles/controller-ulimits + diff --git a/doc/source/roles/role-ctlplane-ip-range.rst b/doc/source/roles/role-ctlplane-ip-range.rst new file mode 100644 index 000000000..d25c34ff9 --- /dev/null +++ b/doc/source/roles/role-ctlplane-ip-range.rst @@ -0,0 +1,7 @@ +================= +ctlplane-ip-range +================= + +.. ansibleautoplugin:: + :role: roles/ctlplane-ip-range + diff --git a/doc/source/roles/role-default-node-count.rst b/doc/source/roles/role-default-node-count.rst new file mode 100644 index 000000000..eb8b66559 --- /dev/null +++ b/doc/source/roles/role-default-node-count.rst @@ -0,0 +1,7 @@ +================== +default-node-count +================== + +.. ansibleautoplugin:: + :role: roles/default-node-count + diff --git a/doc/source/roles/role-dhcp-validations.rst b/doc/source/roles/role-dhcp-validations.rst new file mode 100644 index 000000000..51e3f78e0 --- /dev/null +++ b/doc/source/roles/role-dhcp-validations.rst @@ -0,0 +1,7 @@ +================ +dhcp-validations +================ + +.. ansibleautoplugin:: + :role: roles/dhcp-validations + diff --git a/doc/source/roles/role-dns.rst b/doc/source/roles/role-dns.rst new file mode 100644 index 000000000..2d01ff0b0 --- /dev/null +++ b/doc/source/roles/role-dns.rst @@ -0,0 +1,7 @@ +=== +dns +=== + +.. ansibleautoplugin:: + :role: roles/dns + diff --git a/doc/source/roles/role-haproxy.rst b/doc/source/roles/role-haproxy.rst new file mode 100644 index 000000000..322fb3c86 --- /dev/null +++ b/doc/source/roles/role-haproxy.rst @@ -0,0 +1,7 @@ +======= +haproxy +======= + +.. ansibleautoplugin:: + :role: roles/haproxy + diff --git a/doc/source/roles/role-image-serve.rst b/doc/source/roles/role-image-serve.rst new file mode 100644 index 000000000..4b5d5e013 --- /dev/null +++ b/doc/source/roles/role-image-serve.rst @@ -0,0 +1,7 @@ +=========== +image-serve +=========== + +.. ansibleautoplugin:: + :role: roles/image-serve + diff --git a/doc/source/roles/role-ironic-boot-configuration.rst b/doc/source/roles/role-ironic-boot-configuration.rst new file mode 100644 index 000000000..05aa7070b --- /dev/null +++ b/doc/source/roles/role-ironic-boot-configuration.rst @@ -0,0 +1,7 @@ +========================= +ironic-boot-configuration +========================= + +.. ansibleautoplugin:: + :role: roles/ironic-boot-configuration + diff --git a/doc/source/roles/role-mysql-open-files-limit.rst b/doc/source/roles/role-mysql-open-files-limit.rst new file mode 100644 index 000000000..3fb2d4e78 --- /dev/null +++ b/doc/source/roles/role-mysql-open-files-limit.rst @@ -0,0 +1,7 @@ +====================== +mysql-open-files-limit +====================== + +.. ansibleautoplugin:: + :role: roles/mysql-open-files-limit + diff --git a/doc/source/roles/role-network-environment.rst b/doc/source/roles/role-network-environment.rst new file mode 100644 index 000000000..b71a73e6d --- /dev/null +++ b/doc/source/roles/role-network-environment.rst @@ -0,0 +1,7 @@ +=================== +network-environment +=================== + +.. ansibleautoplugin:: + :role: roles/network-environment + diff --git a/doc/source/roles/role-neutron-sanity-check.rst b/doc/source/roles/role-neutron-sanity-check.rst new file mode 100644 index 000000000..2553b4d60 --- /dev/null +++ b/doc/source/roles/role-neutron-sanity-check.rst @@ -0,0 +1,7 @@ +==================== +neutron-sanity-check +==================== + +.. ansibleautoplugin:: + :role: roles/neutron-sanity-check + diff --git a/doc/source/roles/role-no-op-firewall-nova-driver.rst b/doc/source/roles/role-no-op-firewall-nova-driver.rst new file mode 100644 index 000000000..f16006200 --- /dev/null +++ b/doc/source/roles/role-no-op-firewall-nova-driver.rst @@ -0,0 +1,7 @@ +========================== +no-op-firewall-nova-driver +========================== + +.. ansibleautoplugin:: + :role: roles/no-op-firewall-nova-driver + diff --git a/doc/source/roles/role-no-op.rst b/doc/source/roles/role-no-op.rst new file mode 100644 index 000000000..a1eeea66c --- /dev/null +++ b/doc/source/roles/role-no-op.rst @@ -0,0 +1,7 @@ +===== +no-op +===== + +.. ansibleautoplugin:: + :role: roles/no-op + diff --git a/doc/source/roles/role-node-disks.rst b/doc/source/roles/role-node-disks.rst new file mode 100644 index 000000000..0edca3058 --- /dev/null +++ b/doc/source/roles/role-node-disks.rst @@ -0,0 +1,7 @@ +========== +node-disks +========== + +.. ansibleautoplugin:: + :role: roles/node-disks + diff --git a/doc/source/roles/role-node-health.rst b/doc/source/roles/role-node-health.rst new file mode 100644 index 000000000..3e77a9737 --- /dev/null +++ b/doc/source/roles/role-node-health.rst @@ -0,0 +1,7 @@ +=========== +node-health +=========== + +.. ansibleautoplugin:: + :role: roles/node-health + diff --git a/doc/source/roles/role-nova-event-callback.rst b/doc/source/roles/role-nova-event-callback.rst new file mode 100644 index 000000000..f25454675 --- /dev/null +++ b/doc/source/roles/role-nova-event-callback.rst @@ -0,0 +1,7 @@ +=================== +nova-event-callback +=================== + +.. ansibleautoplugin:: + :role: roles/nova-event-callback + diff --git a/doc/source/roles/role-nova-status.rst b/doc/source/roles/role-nova-status.rst new file mode 100644 index 000000000..dfe91bec7 --- /dev/null +++ b/doc/source/roles/role-nova-status.rst @@ -0,0 +1,7 @@ +=========== +nova-status +=========== + +.. ansibleautoplugin:: + :role: roles/nova-status + diff --git a/doc/source/roles/role-ntp.rst b/doc/source/roles/role-ntp.rst new file mode 100644 index 000000000..701811f95 --- /dev/null +++ b/doc/source/roles/role-ntp.rst @@ -0,0 +1,7 @@ +=== +ntp +=== + +.. ansibleautoplugin:: + :role: roles/ntp + diff --git a/doc/source/roles/role-openshift-on-openstack.rst b/doc/source/roles/role-openshift-on-openstack.rst new file mode 100644 index 000000000..3f3e9a4fe --- /dev/null +++ b/doc/source/roles/role-openshift-on-openstack.rst @@ -0,0 +1,7 @@ +====================== +openshift-on-openstack +====================== + +.. ansibleautoplugin:: + :role: roles/openshift-on-openstack + diff --git a/doc/source/roles/role-openstack-endpoints.rst b/doc/source/roles/role-openstack-endpoints.rst new file mode 100644 index 000000000..cf833521a --- /dev/null +++ b/doc/source/roles/role-openstack-endpoints.rst @@ -0,0 +1,7 @@ +=================== +openstack-endpoints +=================== + +.. ansibleautoplugin:: + :role: roles/openstack-endpoints + diff --git a/doc/source/roles/role-ovs-dpdk-pmd.rst b/doc/source/roles/role-ovs-dpdk-pmd.rst new file mode 100644 index 000000000..dd5086a7e --- /dev/null +++ b/doc/source/roles/role-ovs-dpdk-pmd.rst @@ -0,0 +1,7 @@ +============ +ovs-dpdk-pmd +============ + +.. ansibleautoplugin:: + :role: roles/ovs-dpdk-pmd + diff --git a/doc/source/roles/role-pacemaker-status.rst b/doc/source/roles/role-pacemaker-status.rst new file mode 100644 index 000000000..179f17912 --- /dev/null +++ b/doc/source/roles/role-pacemaker-status.rst @@ -0,0 +1,7 @@ +================ +pacemaker-status +================ + +.. ansibleautoplugin:: + :role: roles/pacemaker-status + diff --git a/doc/source/roles/role-rabbitmq-limits.rst b/doc/source/roles/role-rabbitmq-limits.rst new file mode 100644 index 000000000..e9ade16f5 --- /dev/null +++ b/doc/source/roles/role-rabbitmq-limits.rst @@ -0,0 +1,7 @@ +=============== +rabbitmq-limits +=============== + +.. ansibleautoplugin:: + :role: roles/rabbitmq-limits + diff --git a/doc/source/roles/role-repos.rst b/doc/source/roles/role-repos.rst new file mode 100644 index 000000000..d34a3d634 --- /dev/null +++ b/doc/source/roles/role-repos.rst @@ -0,0 +1,7 @@ +===== +repos +===== + +.. ansibleautoplugin:: + :role: roles/repos + diff --git a/doc/source/roles/role-service-status.rst b/doc/source/roles/role-service-status.rst new file mode 100644 index 000000000..f99e6c381 --- /dev/null +++ b/doc/source/roles/role-service-status.rst @@ -0,0 +1,7 @@ +============== +service-status +============== + +.. ansibleautoplugin:: + :role: roles/service-status + diff --git a/doc/source/roles/role-stack-health.rst b/doc/source/roles/role-stack-health.rst new file mode 100644 index 000000000..432892f96 --- /dev/null +++ b/doc/source/roles/role-stack-health.rst @@ -0,0 +1,7 @@ +============ +stack-health +============ + +.. ansibleautoplugin:: + :role: roles/stack-health + diff --git a/doc/source/roles/role-stonith-exists.rst b/doc/source/roles/role-stonith-exists.rst new file mode 100644 index 000000000..2c8129135 --- /dev/null +++ b/doc/source/roles/role-stonith-exists.rst @@ -0,0 +1,7 @@ +============== +stonith-exists +============== + +.. ansibleautoplugin:: + :role: roles/stonith-exists + diff --git a/doc/source/roles/role-switch-vlans.rst b/doc/source/roles/role-switch-vlans.rst new file mode 100644 index 000000000..48806ef7c --- /dev/null +++ b/doc/source/roles/role-switch-vlans.rst @@ -0,0 +1,7 @@ +============ +switch-vlans +============ + +.. ansibleautoplugin:: + :role: roles/switch-vlans + diff --git a/doc/source/roles/role-tls-everywhere.rst b/doc/source/roles/role-tls-everywhere.rst new file mode 100644 index 000000000..0944db6ba --- /dev/null +++ b/doc/source/roles/role-tls-everywhere.rst @@ -0,0 +1,7 @@ +============== +tls-everywhere +============== + +.. ansibleautoplugin:: + :role: roles/tls-everywhere + diff --git a/doc/source/roles/role-undercloud-cpu.rst b/doc/source/roles/role-undercloud-cpu.rst new file mode 100644 index 000000000..b335cb513 --- /dev/null +++ b/doc/source/roles/role-undercloud-cpu.rst @@ -0,0 +1,7 @@ +============== +undercloud-cpu +============== + +.. ansibleautoplugin:: + :role: roles/undercloud-cpu + diff --git a/doc/source/roles/role-undercloud-debug.rst b/doc/source/roles/role-undercloud-debug.rst new file mode 100644 index 000000000..e576a4e2b --- /dev/null +++ b/doc/source/roles/role-undercloud-debug.rst @@ -0,0 +1,7 @@ +================ +undercloud-debug +================ + +.. ansibleautoplugin:: + :role: roles/undercloud-debug + diff --git a/doc/source/roles/role-undercloud-disk-space.rst b/doc/source/roles/role-undercloud-disk-space.rst new file mode 100644 index 000000000..aa60ac675 --- /dev/null +++ b/doc/source/roles/role-undercloud-disk-space.rst @@ -0,0 +1,7 @@ +===================== +undercloud-disk-space +===================== + +.. ansibleautoplugin:: + :role: roles/undercloud-disk-space + diff --git a/doc/source/roles/role-undercloud-heat-purge-deleted.rst b/doc/source/roles/role-undercloud-heat-purge-deleted.rst new file mode 100644 index 000000000..7c8084fa3 --- /dev/null +++ b/doc/source/roles/role-undercloud-heat-purge-deleted.rst @@ -0,0 +1,7 @@ +============================= +undercloud-heat-purge-deleted +============================= + +.. ansibleautoplugin:: + :role: roles/undercloud-heat-purge-deleted + diff --git a/doc/source/roles/role-undercloud-process-count.rst b/doc/source/roles/role-undercloud-process-count.rst new file mode 100644 index 000000000..94a61a982 --- /dev/null +++ b/doc/source/roles/role-undercloud-process-count.rst @@ -0,0 +1,7 @@ +======================== +undercloud-process-count +======================== + +.. ansibleautoplugin:: + :role: roles/undercloud-process-count + diff --git a/doc/source/roles/role-undercloud-ram.rst b/doc/source/roles/role-undercloud-ram.rst new file mode 100644 index 000000000..67caa9490 --- /dev/null +++ b/doc/source/roles/role-undercloud-ram.rst @@ -0,0 +1,7 @@ +============== +undercloud-ram +============== + +.. ansibleautoplugin:: + :role: roles/undercloud-ram + diff --git a/doc/source/roles/role-undercloud-selinux-mode.rst b/doc/source/roles/role-undercloud-selinux-mode.rst new file mode 100644 index 000000000..a42782c40 --- /dev/null +++ b/doc/source/roles/role-undercloud-selinux-mode.rst @@ -0,0 +1,7 @@ +======================= +undercloud-selinux-mode +======================= + +.. ansibleautoplugin:: + :role: roles/undercloud-selinux-mode + diff --git a/doc/source/roles/role-undercloud-service-status.rst b/doc/source/roles/role-undercloud-service-status.rst new file mode 100644 index 000000000..a7f0b272f --- /dev/null +++ b/doc/source/roles/role-undercloud-service-status.rst @@ -0,0 +1,7 @@ +========================= +undercloud-service-status +========================= + +.. ansibleautoplugin:: + :role: roles/undercloud-service-status + diff --git a/doc/source/roles/role-undercloud-tokenflush.rst b/doc/source/roles/role-undercloud-tokenflush.rst new file mode 100644 index 000000000..f8f1f6f9f --- /dev/null +++ b/doc/source/roles/role-undercloud-tokenflush.rst @@ -0,0 +1,7 @@ +===================== +undercloud-tokenflush +===================== + +.. ansibleautoplugin:: + :role: roles/undercloud-tokenflush + diff --git a/doc/source/roles/role-xfs-check-ftype.rst b/doc/source/roles/role-xfs-check-ftype.rst new file mode 100644 index 000000000..212cf485c --- /dev/null +++ b/doc/source/roles/role-xfs-check-ftype.rst @@ -0,0 +1,8 @@ +=============== +xfs-check-ftype +=============== + +.. ansibleautoplugin:: + :role: roles/xfs-check-ftype + + diff --git a/library/check_flavors.py b/library/check_flavors.py index b7664b100..5c34c4dd8 100644 --- a/library/check_flavors.py +++ b/library/check_flavors.py @@ -23,8 +23,8 @@ module: check_flavors short_description: Check that assigned flavors exist and are configured description: - Validate that the flavors assigned to roles exist and have the correct - settings. Right now, that means that boot_option is unset or set to 'local' - , or if set to 'netboot', issue a warning. + settings. Right now, that means that boot_option is unset or set to + 'local', or if set to 'netboot', issue a warning. options: roles_info: required: true diff --git a/library/check_ironic_boot_config.py b/library/check_ironic_boot_config.py index c1bd23399..05672c74a 100644 --- a/library/check_ironic_boot_config.py +++ b/library/check_ironic_boot_config.py @@ -21,10 +21,10 @@ from ansible.module_utils.basic import AnsibleModule # noqa DOCUMENTATION = ''' --- module: check_ironic_boot_config -short_description: > +short_description: - Check that overcloud nodes have the correct associated ramdisk and kernel image -description: > +description: - Each overcloud node needs to have the correct associated ramdisk and kernel image according to its architecture and platform. When it does appear that the correct image is associated, we also need to check that diff --git a/library/check_package_update.py b/library/check_package_update.py index b016c1dee..4b19f689a 100755 --- a/library/check_package_update.py +++ b/library/check_package_update.py @@ -25,6 +25,8 @@ DOCUMENTATION = ''' --- module: check_package_update short_description: Check for available updates for a given package +description: + - Check for available updates for a given package options: package: required: true @@ -45,7 +47,7 @@ EXAMPLES = ''' - name: Get available updates for packages check_package_update: package: python-tripleoclient - pkg_mgr: {{ ansible_pkg_mgr}} + pkg_mgr: "{{ ansible_pkg_mgr}}" ''' SUPPORTED_PKG_MGRS = ( diff --git a/library/node_disks.py b/library/node_disks.py index b9607e799..f1893d21c 100644 --- a/library/node_disks.py +++ b/library/node_disks.py @@ -22,7 +22,7 @@ module: node_disks short_description: Check disks, flavors and root device hints description: - Check if each node has a root device hint set if there is more - than one disk and compare flavors to disk sizes. + than one disk and compare flavors to disk sizes. options: nodes: required: true diff --git a/library/switch_vlans.py b/library/switch_vlans.py index d1aa11c34..717b71163 100644 --- a/library/switch_vlans.py +++ b/library/switch_vlans.py @@ -35,8 +35,8 @@ module: switch_vlans short_description: Check configured VLANs against Ironic introspection data description: - Validate that the VLANs defined in TripleO nic config files are in the - LLDP info received from network switches. The LLDP data is stored in - Ironic introspection data per interface. + LLDP info received from network switches. The LLDP data is stored in + Ironic introspection data per interface. options: path: required: true diff --git a/role-addition.yml b/role-addition.yml index aa9dbe37b..ec446d8dd 100644 --- a/role-addition.yml +++ b/role-addition.yml @@ -33,3 +33,14 @@ --init-path=roles {{ role_name }} args: creates: "roles/{{ role_name }}" + + - name: Create role documentation + copy: + content: | + {{ '=' * (role_name | length) }} + {{ role_name }} + {{ '=' * (role_name | length) }} + + .. ansibleautoplugin:: + :role: roles/{{ role_name }} + dest: "doc/source/roles/role-{{ role_name }}.rst" diff --git a/roles/undercloud-selinux-mode/defaults/main.yml b/roles/undercloud-selinux-mode/defaults/main.yml deleted file mode 100644 index ed97d539c..000000000 --- a/roles/undercloud-selinux-mode/defaults/main.yml +++ /dev/null @@ -1 +0,0 @@ ----