From d9b2ee9f30dfe42e3134ce9ad4d859db30ab9bf7 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Fri, 12 Jul 2019 19:30:11 -0500 Subject: [PATCH] Update all role docs to use the ansible autodoc plugin The ansible autodoc sphinx plugin has been updated to automatically create role documentation for a given role. Because we can now auto doc all of our roles, all roles with missing documentation have been added. Because the ansible autodoc plugin has been made more functional it has been renamed. The role addition playbook has been updated to use the new autodoc module whenever a role is created. Change-Id: I806217202884fc744fbb26a754617c0125be2857 Signed-off-by: Kevin Carter --- doc/source/_exts/ansible-autodoc.py | 322 ++++++++++++++++++ doc/source/_exts/ansible-module-autodoc.py | 175 ---------- doc/source/conf.py | 2 +- doc/source/roles/role-aide.rst | 21 +- .../roles/role-octavia-controller-config.rst | 6 + ...le-octavia-controller-post-config copy.rst | 6 + .../roles/role-octavia-overcloud-config.rst | 6 + doc/source/roles/role-octavia-undercloud.rst | 6 + doc/source/roles/role-octavia_common.rst | 6 + doc/source/roles/role-test_deps.rst | 13 +- .../roles/role-test_json_error_callback.rst | 13 +- doc/source/roles/role-test_package_action.rst | 13 +- doc/source/roles/role-tripleo-bootstrap.rst | 21 +- doc/source/roles/role-tripleo-ceph-common.rst | 6 + .../roles/role-tripleo-ceph-fetch-dir.rst | 6 + .../roles/role-tripleo-ceph-run-ansible.rst | 6 + doc/source/roles/role-tripleo-ceph-uuid.rst | 6 + .../roles/role-tripleo-ceph-work-dir.rst | 6 + .../roles/role-tripleo-container-rm.rst | 29 +- .../roles/role-tripleo-container-tag.rst | 29 +- .../roles/role-tripleo-create-admin.rst | 36 +- doc/source/roles/role-tripleo-docker-rm.rst | 21 +- doc/source/roles/role-tripleo-image-serve.rst | 21 +- doc/source/roles/role-tripleo-module-load.rst | 29 +- .../roles/role-tripleo-ssh-known-hosts.rst | 21 +- doc/source/roles/role-tripleo-transfer.rst | 21 +- doc/source/roles/role-tuned.rst | 21 +- role-addition.yml | 21 +- 28 files changed, 413 insertions(+), 476 deletions(-) create mode 100644 doc/source/_exts/ansible-autodoc.py delete mode 100644 doc/source/_exts/ansible-module-autodoc.py create mode 100644 doc/source/roles/role-octavia-controller-config.rst create mode 100644 doc/source/roles/role-octavia-controller-post-config copy.rst create mode 100644 doc/source/roles/role-octavia-overcloud-config.rst create mode 100644 doc/source/roles/role-octavia-undercloud.rst create mode 100644 doc/source/roles/role-octavia_common.rst create mode 100644 doc/source/roles/role-tripleo-ceph-common.rst create mode 100644 doc/source/roles/role-tripleo-ceph-fetch-dir.rst create mode 100644 doc/source/roles/role-tripleo-ceph-run-ansible.rst create mode 100644 doc/source/roles/role-tripleo-ceph-uuid.rst create mode 100644 doc/source/roles/role-tripleo-ceph-work-dir.rst diff --git a/doc/source/_exts/ansible-autodoc.py b/doc/source/_exts/ansible-autodoc.py new file mode 100644 index 000000000..8a81bd9eb --- /dev/null +++ b/doc/source/_exts/ansible-autodoc.py @@ -0,0 +1,322 @@ +# 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 + +from sphinx import addnodes + +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_list = nodes.field_list() + 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()) + + driver_data = molecule_conf.get('driver') + if driver_data: + molecule_section.append( + nodes.field_name( + text='Driver: {}'.format( + driver_data['name'] + ) + ) + ) + + options = driver_data.get('options') + if options: + molecule_section.append( + self._yaml_section( + to_yaml_data=options, + section_title='Molecule Options' + ) + ) + + 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_list.append(molecule_section) + else: + test_section.append(test_list) + section.append(test_section) + + self.run_returns.append(section) + + def _run_module(self, module): + if self.options.get('documentation'): + docs = self.build_documentation(module=module) + self.run_returns.append( + self.make_node( + title="Module Documentation", + contents=docs + ) + ) + + if self.options.get('examples'): + examples = self.build_examples(module=module) + self.run_returns.append( + self.make_node( + title="Example Tasks", + 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/ansible-module-autodoc.py b/doc/source/_exts/ansible-module-autodoc.py deleted file mode 100644 index aed0a8ca2..000000000 --- a/doc/source/_exts/ansible-module-autodoc.py +++ /dev/null @@ -1,175 +0,0 @@ -# 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 - -from sphinx import addnodes - -import yaml - - -class AnsibleAutoPluginDirective(Directive): - directive_name = "ansibleautoplugin" - has_content = True - option_spec = { - 'module': rst.directives.unchanged_required, - '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 = nodes.section( - title, - nodes.title(text=title), - ids=[nodes.make_id(__file__)], - ) - - if not content_type: - # Doc section - for content in contents['docs']: - for paragraph in content.split('\n'): - retnode = nodes.paragraph() - html = self._render_html(source=paragraph) - retnode += nodes.raw('', html['body'], format='html') - section.append(retnode) - - # Options Section - options_list = nodes.field_list() - options_section = nodes.section( - 'Options', - nodes.title(text='Options'), - ids=[nodes.make_id(__file__)], - ) - for key, value in contents['options'].items(): - body = nodes.field_body() - if isinstance(value['description'], list): - for desc in value['description']: - html = self._render_html(source=desc) - body.append( - nodes.raw('', html['body'], format='html') - ) - else: - html = self._render_html(source=value['description']) - body.append( - nodes.raw('', html['body'], format='html') - ) - - field = nodes.field() - field.append(nodes.field_name(text=key)) - field.append(body) - options_list.append(field) - else: - options_section.append(options_list) - section.append(options_section) - - # Authors Section - authors_list = nodes.field_list() - authors_section = nodes.section( - 'Authors', - nodes.title(text='Authors'), - ids=[nodes.make_id(__file__)], - ) - field = nodes.field() - field.append(nodes.field_name(text='')) - for author in contents['author']: - body = nodes.field_body() - html = self._render_html(source=author) - body.append( - nodes.raw('', html['body'], format='html') - ) - field.append(body) - else: - authors_list.append(field) - authors_section.append(authors_list) - section.append(authors_section) - - elif content_type == 'yaml': - for content in contents: - retnode = nodes.literal_block(text=content) - retnode['language'] = 'yaml' - section.append(retnode) - - return section - - def load_module(self, filename): - return imp.load_source('__ansible_module__', filename) - - def build_documentation(self, 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 - - def build_examples(self, 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 run(self): - module = self.load_module(filename=self.options['module']) - return_data = list() - if self.options.get('documentation'): - docs = self.build_documentation(module=module) - return_data.append( - self.make_node( - title="Module Documentation", - contents=docs - ) - ) - - if self.options.get('examples'): - examples = self.build_examples(module=module) - return_data.append( - self.make_node( - title="Example Tasks", - contents=examples, - content_type='yaml' - ) - ) - - return return_data - - -def setup(app): - classes = [ - AnsibleAutoPluginDirective, - ] - for directive_class in classes: - app.add_directive(directive_class.directive_name, directive_class) - - return {'version': '0.1'} diff --git a/doc/source/conf.py b/doc/source/conf.py index 4cf145cc6..b47248c2c 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -27,7 +27,7 @@ sys.path.insert(0, os.path.join(os.path.abspath('.'), '_exts')) extensions = [ 'openstackdocstheme', 'sphinx.ext.autodoc', - 'ansible-module-autodoc' + 'ansible-autodoc' ] # autodoc generation is a bit aggressive and a nuisance when doing heavy diff --git a/doc/source/roles/role-aide.rst b/doc/source/roles/role-aide.rst index 0456b822a..225594860 100644 --- a/doc/source/roles/role-aide.rst +++ b/doc/source/roles/role-aide.rst @@ -2,22 +2,5 @@ Role - aide =========== -This role provides for the following services: - - * aide - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/aide/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/aide/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/aide diff --git a/doc/source/roles/role-octavia-controller-config.rst b/doc/source/roles/role-octavia-controller-config.rst new file mode 100644 index 000000000..9c88fc232 --- /dev/null +++ b/doc/source/roles/role-octavia-controller-config.rst @@ -0,0 +1,6 @@ +================================ +Role - octavia-controller-config +================================ + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/octavia-controller-config diff --git a/doc/source/roles/role-octavia-controller-post-config copy.rst b/doc/source/roles/role-octavia-controller-post-config copy.rst new file mode 100644 index 000000000..da707e2cf --- /dev/null +++ b/doc/source/roles/role-octavia-controller-post-config copy.rst @@ -0,0 +1,6 @@ +=============================== +Role - octavia-overcloud-config +=============================== + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/octavia-overcloud-config diff --git a/doc/source/roles/role-octavia-overcloud-config.rst b/doc/source/roles/role-octavia-overcloud-config.rst new file mode 100644 index 000000000..83350c706 --- /dev/null +++ b/doc/source/roles/role-octavia-overcloud-config.rst @@ -0,0 +1,6 @@ +===================================== +Role - octavia-controller-post-config +===================================== + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/octavia-controller-post-config diff --git a/doc/source/roles/role-octavia-undercloud.rst b/doc/source/roles/role-octavia-undercloud.rst new file mode 100644 index 000000000..3ddbe805e --- /dev/null +++ b/doc/source/roles/role-octavia-undercloud.rst @@ -0,0 +1,6 @@ +========================= +Role - octavia-undercloud +========================= + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/octavia-undercloud diff --git a/doc/source/roles/role-octavia_common.rst b/doc/source/roles/role-octavia_common.rst new file mode 100644 index 000000000..ba11577b4 --- /dev/null +++ b/doc/source/roles/role-octavia_common.rst @@ -0,0 +1,6 @@ +===================== +Role - octavia_common +===================== + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/octavia_common diff --git a/doc/source/roles/role-test_deps.rst b/doc/source/roles/role-test_deps.rst index b28d9463c..94218ff62 100644 --- a/doc/source/roles/role-test_deps.rst +++ b/doc/source/roles/role-test_deps.rst @@ -2,14 +2,5 @@ Role - test_deps ================ -This role provides for the following services: - - * test_deps - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/test_deps/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/test_deps diff --git a/doc/source/roles/role-test_json_error_callback.rst b/doc/source/roles/role-test_json_error_callback.rst index 62430ad27..3588fa068 100644 --- a/doc/source/roles/role-test_json_error_callback.rst +++ b/doc/source/roles/role-test_json_error_callback.rst @@ -2,14 +2,5 @@ Role - test_json_error_callback =============================== -This role provides for the following services: - - * test_json_error_callback - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/test_json_error_callback/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/test_json_error_callback diff --git a/doc/source/roles/role-test_package_action.rst b/doc/source/roles/role-test_package_action.rst index edbba9b55..609503862 100644 --- a/doc/source/roles/role-test_package_action.rst +++ b/doc/source/roles/role-test_package_action.rst @@ -2,14 +2,5 @@ Role - test_package_action ========================== -This role provides for the following services: - - * test_package_action - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/test_package_action/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/test_package_action diff --git a/doc/source/roles/role-tripleo-bootstrap.rst b/doc/source/roles/role-tripleo-bootstrap.rst index 07d746357..4dfd90dd8 100644 --- a/doc/source/roles/role-tripleo-bootstrap.rst +++ b/doc/source/roles/role-tripleo-bootstrap.rst @@ -2,22 +2,5 @@ Role - tripleo-bootstrap ======================== -This role provides for the following services: - - * tripleo-bootstrap - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-bootstrap/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-bootstrap/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-bootstrap diff --git a/doc/source/roles/role-tripleo-ceph-common.rst b/doc/source/roles/role-tripleo-ceph-common.rst new file mode 100644 index 000000000..ebbf67ecf --- /dev/null +++ b/doc/source/roles/role-tripleo-ceph-common.rst @@ -0,0 +1,6 @@ +========================== +Role - tripleo-ceph-common +========================== + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-ceph-common diff --git a/doc/source/roles/role-tripleo-ceph-fetch-dir.rst b/doc/source/roles/role-tripleo-ceph-fetch-dir.rst new file mode 100644 index 000000000..d514b395f --- /dev/null +++ b/doc/source/roles/role-tripleo-ceph-fetch-dir.rst @@ -0,0 +1,6 @@ +============================= +Role - tripleo-ceph-fetch-dir +============================= + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-ceph-fetch-dir diff --git a/doc/source/roles/role-tripleo-ceph-run-ansible.rst b/doc/source/roles/role-tripleo-ceph-run-ansible.rst new file mode 100644 index 000000000..9f87bef24 --- /dev/null +++ b/doc/source/roles/role-tripleo-ceph-run-ansible.rst @@ -0,0 +1,6 @@ +=============================== +Role - tripleo-ceph-run-ansible +=============================== + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-ceph-run-ansible diff --git a/doc/source/roles/role-tripleo-ceph-uuid.rst b/doc/source/roles/role-tripleo-ceph-uuid.rst new file mode 100644 index 000000000..9afcdad06 --- /dev/null +++ b/doc/source/roles/role-tripleo-ceph-uuid.rst @@ -0,0 +1,6 @@ +======================== +Role - tripleo-ceph-uuid +======================== + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-ceph-uuid diff --git a/doc/source/roles/role-tripleo-ceph-work-dir.rst b/doc/source/roles/role-tripleo-ceph-work-dir.rst new file mode 100644 index 000000000..9842e16dc --- /dev/null +++ b/doc/source/roles/role-tripleo-ceph-work-dir.rst @@ -0,0 +1,6 @@ +============================ +Role - tripleo-ceph-work-dir +============================ + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-ceph-work-dir diff --git a/doc/source/roles/role-tripleo-container-rm.rst b/doc/source/roles/role-tripleo-container-rm.rst index 450a754d1..5f44a2aa4 100644 --- a/doc/source/roles/role-tripleo-container-rm.rst +++ b/doc/source/roles/role-tripleo-container-rm.rst @@ -2,30 +2,5 @@ Role - tripleo-container-rm =========================== -This role provides for the following services: - - * tripleo-container-rm - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-container-rm/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example default playbook -~~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-container-rm/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. - - -Example docker playbook -~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-container-rm/molecule/podman/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-container-rm diff --git a/doc/source/roles/role-tripleo-container-tag.rst b/doc/source/roles/role-tripleo-container-tag.rst index 2b526e1a9..3dfb5fa8b 100644 --- a/doc/source/roles/role-tripleo-container-tag.rst +++ b/doc/source/roles/role-tripleo-container-tag.rst @@ -2,30 +2,5 @@ Role - tripleo-container-tag ============================ -This role provides for the following services: - - * tripleo-container-tag - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-container-tag/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example default playbook -~~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-container-tag/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. - - -Example podman playbook -~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-container-tag/molecule/podman/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-container-tag diff --git a/doc/source/roles/role-tripleo-create-admin.rst b/doc/source/roles/role-tripleo-create-admin.rst index 7ae71226c..069d15c9c 100644 --- a/doc/source/roles/role-tripleo-create-admin.rst +++ b/doc/source/roles/role-tripleo-create-admin.rst @@ -2,37 +2,5 @@ Role - tripleo-create-admin =========================== -This role provides for the following services: - - * tripleo-create-admin - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-create-admin/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example default playbook -~~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-create-admin/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. - - -Example keygen playbook -~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-create-admin/molecule/keygen/playbook.yml - :language: yaml - :start-after: under the License. - -Authorize existing user -^^^^^^^^^^^^^^^^^^^^^^^ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-create-admin/molecule/addkey/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-create-admin diff --git a/doc/source/roles/role-tripleo-docker-rm.rst b/doc/source/roles/role-tripleo-docker-rm.rst index e10c90809..1237f53cf 100644 --- a/doc/source/roles/role-tripleo-docker-rm.rst +++ b/doc/source/roles/role-tripleo-docker-rm.rst @@ -2,11 +2,6 @@ Role - tripleo-docker-rm ======================== -This role provides for the following services: - - * tripleo-docker-rm - - .. DANGER:: This role is a linked role to `tripleo-container-rm`. This role and exists @@ -15,17 +10,5 @@ This role provides for the following services: `tripleo-container-rm`. -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-docker-rm/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-docker-rm/molecule/docker_rm/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-docker-rm diff --git a/doc/source/roles/role-tripleo-image-serve.rst b/doc/source/roles/role-tripleo-image-serve.rst index d3b84cfe4..127f156c7 100644 --- a/doc/source/roles/role-tripleo-image-serve.rst +++ b/doc/source/roles/role-tripleo-image-serve.rst @@ -2,22 +2,5 @@ Role - tripleo-image-serve ========================== -This role provides for the following services: - - * tripleo-image-serve - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-image-serve/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-image-serve/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-image-serve diff --git a/doc/source/roles/role-tripleo-module-load.rst b/doc/source/roles/role-tripleo-module-load.rst index 30754e744..7beb07116 100644 --- a/doc/source/roles/role-tripleo-module-load.rst +++ b/doc/source/roles/role-tripleo-module-load.rst @@ -2,30 +2,5 @@ Role - tripleo-module-load ========================== -This role provides for the following services: - - * tripleo-module-load - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-module-load/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example default playbook -~~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-module-load/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. - - -Example module remove playbook -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-module-load/molecule/remove_module/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-module-load diff --git a/doc/source/roles/role-tripleo-ssh-known-hosts.rst b/doc/source/roles/role-tripleo-ssh-known-hosts.rst index f5dc327ff..61355ba38 100644 --- a/doc/source/roles/role-tripleo-ssh-known-hosts.rst +++ b/doc/source/roles/role-tripleo-ssh-known-hosts.rst @@ -2,22 +2,5 @@ Role - tripleo-ssh-known-hosts ============================== -This role provides for the following services: - - * tripleo-ssh-known-hosts - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-ssh-known-hosts/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-ssh-known-hosts/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-ssh-known-hosts diff --git a/doc/source/roles/role-tripleo-transfer.rst b/doc/source/roles/role-tripleo-transfer.rst index 0dd0dd3d5..28ce16d2e 100644 --- a/doc/source/roles/role-tripleo-transfer.rst +++ b/doc/source/roles/role-tripleo-transfer.rst @@ -2,22 +2,5 @@ Role - tripleo-transfer ======================= -This role provides for the following services: - - * tripleo-transfer - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-transfer/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tripleo-transfer/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-transfer diff --git a/doc/source/roles/role-tuned.rst b/doc/source/roles/role-tuned.rst index 6b31b261a..f79d0dc95 100644 --- a/doc/source/roles/role-tuned.rst +++ b/doc/source/roles/role-tuned.rst @@ -2,22 +2,5 @@ Role - tuned ============ -This role provides for the following services: - - * tuned - - -Default variables -~~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tuned/defaults/main.yml - :language: yaml - :start-after: under the License. - - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../../tripleo_ansible/roles/tuned/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tuned diff --git a/role-addition.yml b/role-addition.yml index 0375dc47b..45d3a10dd 100644 --- a/role-addition.yml +++ b/role-addition.yml @@ -87,23 +87,6 @@ {{ opening }} {{ '=' * (opening | length) }} - This role provides for the following services: - - * {{ role_name }} - - - Default variables - ~~~~~~~~~~~~~~~~~ - - .. literalinclude:: ../../../tripleo_ansible/roles/{{ role_name }}/defaults/main.yml - :language: yaml - :start-after: under the License. - - - Example playbook - ~~~~~~~~~~~~~~~~ - - .. literalinclude:: ../../../tripleo_ansible/roles/{{ role_name }}/molecule/default/playbook.yml - :language: yaml - :start-after: under the License. + .. ansibleautoplugin:: + :role: tripleo_ansible/roles/{{ role_name }} dest: "doc/source/roles/role-{{ role_name }}.rst"