From a8641a13a21c1c3cd34899fe973b533675109525 Mon Sep 17 00:00:00 2001 From: juliopdx Date: Wed, 11 Oct 2023 15:41:04 -0700 Subject: [PATCH 01/15] updating build file, links, outputs --- Makefile | 5 +- .../arista/cvp/docs/_build/ansible2rst.py | 453 -------------- .../cvp/docs/_build/cv_change_control_v3.rst | 210 ------- .../arista/cvp/docs/_build/cv_configlet.rst | 176 ------ .../cvp/docs/_build/cv_configlet_v3.rst | 117 ---- .../arista/cvp/docs/_build/cv_container.rst | 148 ----- .../cvp/docs/_build/cv_container_v3.rst | 137 ----- .../arista/cvp/docs/_build/cv_device.rst | 185 ------ .../arista/cvp/docs/_build/cv_device_v3.rst | 215 ------- .../arista/cvp/docs/_build/cv_facts.rst | 123 ---- .../arista/cvp/docs/_build/cv_facts_v3.rst | 139 ----- .../arista/cvp/docs/_build/cv_image_v3.rst | 155 ----- .../arista/cvp/docs/_build/cv_tag_v3.rst | 240 -------- .../arista/cvp/docs/_build/cv_task.rst | 129 ---- .../arista/cvp/docs/_build/cv_task_v3.rst | 89 --- .../arista/cvp/docs/_build/cv_validate_v3.rst | 117 ---- .../arista/cvp/docs/_build/index.rst | 36 -- .../arista/cvp/docs/_build/rst.j2 | 562 ------------------ .../arista/cvp/docs/build-md/doc.py | 43 ++ .../arista/cvp/docs/build-md/templates/md.j2 | 60 ++ .../cvp/docs/how-to/v3/cv_configlet_v3.md | 2 +- .../cvp/docs/how-to/v3/cv_container_v3.md | 2 +- .../arista/cvp/docs/how-to/v3/cv_device_v3.md | 2 +- .../cvp/docs/modules/cv_change_control_v3.md | 134 +++++ .../docs/modules/cv_change_control_v3.rst.md | 186 ------ .../arista/cvp/docs/modules/cv_configlet.md | 67 +++ .../cvp/docs/modules/cv_configlet.rst.md | 141 ----- .../cvp/docs/modules/cv_configlet_v3.md | 55 ++ .../cvp/docs/modules/cv_configlet_v3.rst.md | 96 --- .../arista/cvp/docs/modules/cv_container.md | 61 ++ .../cvp/docs/modules/cv_container.rst.md | 115 ---- .../cvp/docs/modules/cv_container_v3.md | 74 +++ .../cvp/docs/modules/cv_container_v3.rst.md | 117 ---- .../arista/cvp/docs/modules/cv_device.md | 86 +++ .../arista/cvp/docs/modules/cv_device.rst.md | 154 ----- .../arista/cvp/docs/modules/cv_device_v3.md | 166 ++++++ .../cvp/docs/modules/cv_device_v3.rst.md | 194 ------ .../arista/cvp/docs/modules/cv_facts.md | 61 ++ .../arista/cvp/docs/modules/cv_facts.rst.md | 102 ---- .../arista/cvp/docs/modules/cv_facts_v3.md | 77 +++ .../cvp/docs/modules/cv_facts_v3.rst.md | 120 ---- .../arista/cvp/docs/modules/cv_image_v3.md | 75 +++ .../cvp/docs/modules/cv_image_v3.rst.md | 135 ----- .../arista/cvp/docs/modules/cv_tag_v3.md | 177 ++++++ .../arista/cvp/docs/modules/cv_tag_v3.rst.md | 219 ------- .../arista/cvp/docs/modules/cv_task.md | 52 ++ .../arista/cvp/docs/modules/cv_task.rst.md | 95 --- .../arista/cvp/docs/modules/cv_task_v3.md | 39 ++ .../arista/cvp/docs/modules/cv_task_v3.rst.md | 69 --- .../arista/cvp/docs/modules/cv_validate_v3.md | 70 +++ .../cvp/docs/modules/cv_validate_v3.rst.md | 102 ---- .../cvp/docs/outputs/change_control_v3.txt | 36 ++ .../plugins/modules/cv_change_control_v3.py | 15 +- .../cvp/plugins/modules/cv_configlet.py | 12 +- .../cvp/plugins/modules/cv_configlet_v3.py | 4 +- .../cvp/plugins/modules/cv_container.py | 12 +- .../cvp/plugins/modules/cv_container_v3.py | 9 +- .../arista/cvp/plugins/modules/cv_device.py | 17 +- .../cvp/plugins/modules/cv_device_v3.py | 5 +- .../arista/cvp/plugins/modules/cv_facts.py | 18 +- .../arista/cvp/plugins/modules/cv_facts_v3.py | 6 +- .../arista/cvp/plugins/modules/cv_image_v3.py | 10 +- .../arista/cvp/plugins/modules/cv_tag_v3.py | 11 +- .../arista/cvp/plugins/modules/cv_task.py | 14 +- .../arista/cvp/plugins/modules/cv_task_v3.py | 4 +- .../cvp/plugins/modules/cv_validate_v3.py | 1 + mkdocs.yml | 28 +- 67 files changed, 1421 insertions(+), 5165 deletions(-) delete mode 100644 ansible_collections/arista/cvp/docs/_build/ansible2rst.py delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_change_control_v3.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_configlet.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_configlet_v3.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_container.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_container_v3.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_device.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_device_v3.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_facts.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_facts_v3.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_image_v3.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_tag_v3.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_task.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_task_v3.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/cv_validate_v3.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/index.rst delete mode 100644 ansible_collections/arista/cvp/docs/_build/rst.j2 create mode 100644 ansible_collections/arista/cvp/docs/build-md/doc.py create mode 100644 ansible_collections/arista/cvp/docs/build-md/templates/md.j2 create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_configlet.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_configlet.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_container.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_container.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_container_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_container_v3.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_device.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_device.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_device_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_device_v3.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_facts.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_facts.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_facts_v3.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_image_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_image_v3.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_tag_v3.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_task.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_task.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_task_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_task_v3.rst.md create mode 100644 ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/modules/cv_validate_v3.rst.md create mode 100644 ansible_collections/arista/cvp/docs/outputs/change_control_v3.txt diff --git a/Makefile b/Makefile index 3f01ee215..9f5e94830 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ ANSIBLE_TEST_MODE ?= docker # Python version to use in testing. ANSIBLE_TEST_PYTHON ?= 3.6 # Root path for MKDOCS content -WEBDOC_BUILD = ansible_collections/arista/cvp/docs/_build +WEBDOC_BUILD = ansible_collections/arista/cvp/docs/build-md COMPOSE_FILE ?= development/docker-compose.yml MUFFET_TIMEOUT ?= 60 @@ -91,8 +91,7 @@ build-docker3: ## [DEPRECATED] visit https://github.com/arista-netdevops-communi .PHONY: webdoc webdoc: ## Build documentation to publish static content ( cd $(WEBDOC_BUILD) ; \ - python ansible2rst.py ; \ - find . -name 'cv_*_v3.rst' -exec pandoc {} --from rst --to gfm -o ../modules/{}.md \;) + python doc.py) cp $(CURRENT_DIR)/contributing.md $(WEBDOC_BUILD)/.. ;\ .PHONY: check-cvp-404 diff --git a/ansible_collections/arista/cvp/docs/_build/ansible2rst.py b/ansible_collections/arista/cvp/docs/_build/ansible2rst.py deleted file mode 100644 index a1cc8a3fe..000000000 --- a/ansible_collections/arista/cvp/docs/_build/ansible2rst.py +++ /dev/null @@ -1,453 +0,0 @@ -#!/usr/bin/env python -# (c) 2012, Jan-Piet Mens -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - -import os -import re -import datetime -import cgi -import yaml -from jinja2 import Environment, FileSystemLoader -from ansible.module_utils.six import print_ -from ansible.module_utils.common._collections_compat import MutableMapping, MutableSet, MutableSequence -from ansible.module_utils.six import iteritems, string_types -from ansible.parsing.plugin_docs import read_docstring -from ansible.parsing.yaml.loader import AnsibleLoader -from ansible.plugins.loader import fragment_loader -from ansible.module_utils._text import to_bytes -from ansible.errors import AnsibleError - -try: - from html import escape as html_escape -except ImportError: - # Python-3.2 or later - import cgi - - def html_escape(text, quote=True): - return cgi.escape(text, quote) - -from ansible import __version__ as ansible_version - -# TODO - use f-strings -# pylint: disable=consider-using-f-string - -##################################################################################### -# constants and paths - -# if a module is added in a version of Ansible older than this, don't print the version added information -# in the module documentation because everyone is assumed to be running something newer than this already. -TO_OLD_TO_BE_NOTABLE = 1.3 - -_ITALIC = re.compile(r"I\(([^)]+)\)") -_BOLD = re.compile(r"B\(([^)]+)\)") -_MODULE = re.compile(r"M\(([^)]+)\)") -_URL_W_TEXT = re.compile(r"U\(([^)^|]+)\|([^)]+)\)") -_URL = re.compile(r"U\(([^)^|]+)\)") -_CONST = re.compile(r"C\(([^)]+)\)") -_UNDERSCORE = re.compile(r"_") -DEPRECATED = b" (D)" - -MODULE_NAME_STARTS_WITH = "cv_" -MODULEDIR = "../../plugins/modules/" -OUTPUTDIR = "./" - -##################################################################################### - - -def too_old(added): - if not added: - return False - try: - added_tokens = str(added).split(".") - readded = added_tokens[0] + "." + added_tokens[1] - added_float = float(readded) - except ValueError: - return False - return added_float < TO_OLD_TO_BE_NOTABLE - -##################################################################################### - - -def rst_ify(text): - ''' convert symbols like I(this is in italics) to valid restructured text ''' - - try: - t = _ITALIC.sub(r'*' + r"\1" + r"*", text) - t = _BOLD.sub(r'**' + r"\1" + r"**", t) - t = _MODULE.sub(r':ref:`' + r"\1 <\1>" + r"`", t) - t = _URL_W_TEXT.sub(r'`' + r"\1" + r" <" + r"\2" + r">`_", t) - t = _URL.sub(r'`' + r"\1" + r" <" + r"\1" + r">`_", t) - t = _CONST.sub(r'``' + r"\1" + r"``", t) - except Exception as e: - raise AnsibleError("Could not process (%s) : %s" % (str(text), str(e))) - - return t - -##################################################################################### - - -def module_to_html(matchobj): - if matchobj.group(1) is not None: - module_name = matchobj.group(1) - module_href = _UNDERSCORE.sub('-', module_name) - return '' + \ - module_name + '' - return '' - - -def html_ify(text): - ''' convert symbols like I(this is in italics) to valid HTML ''' - - t = html_escape(text) - t = _ITALIC.sub("" + r"\1" + "", t) - t = _BOLD.sub("" + r"\1" + "", t) - t = _MODULE.sub(module_to_html, t) - t = _URL_W_TEXT.sub("" + r"\1" + "", t) - t = _URL.sub("" + r"\1" + "", t) - t = _CONST.sub("" + r"\1" + "", t) - - return t - - -##################################################################################### - - -def rst_fmt(text, fmt): - ''' helper for Jinja2 to do format strings ''' - - return fmt % (text) - -##################################################################################### - - -def rst_xline(width, char="="): - ''' return a restructured text line of a given length ''' - - return char * width - -##################################################################################### - - -def write_data(text, outputname, module, output_dir=None): - ''' dumps module output to a file or the screen, as requested ''' - - if output_dir is not None: - if not os.path.exists(output_dir): - os.makedirs(output_dir) - fname = os.path.join(output_dir, outputname % (module)) - with open(fname, 'wb') as f: - f.write(to_bytes(text)) - else: - print(text) - -##################################################################################### - - -def jinja2_environment(template_dir, template_type): - - env = Environment(loader=FileSystemLoader(template_dir), - variable_start_string="@{", - variable_end_string="}@", - trim_blocks=True, - ) - env.globals['xline'] = rst_xline - - if template_type == 'rst': - env.filters['convert_symbols_to_format'] = rst_ify - env.filters['html_ify'] = html_ify - env.filters['fmt'] = rst_fmt - env.filters['xline'] = rst_xline - template = env.get_template('rst.j2') - outputname = "%s.rst" - else: - raise TypeError(f"unknown module format type: {template_type}") - - return env, template, outputname - -##################################################################################### - - -def add_fragments(doc, filename): - - fragments = doc.get('extends_documentation_fragment', []) - - if isinstance(fragments, string_types): - fragments = [fragments] - - # Allow the module to specify a var other than DOCUMENTATION - # to pull the fragment from, using dot notation as a separator - for fragment_slug in fragments: - fragment_slug = fragment_slug.lower() - if '.' in fragment_slug: - fragment_name, fragment_var = fragment_slug.split('.', 1) - fragment_var = fragment_var.upper() - else: - fragment_name, fragment_var = fragment_slug, 'DOCUMENTATION' - - fragment_loader.add_directory('../../plugins/modules/') - fragment_class = fragment_loader.get(fragment_name) - assert fragment_class is not None - - fragment_yaml = getattr(fragment_class, fragment_var, '{}') - fragment = AnsibleLoader( - fragment_yaml, file_name=filename).get_single_data() - - if 'notes' in fragment: - notes = fragment.pop('notes') - if notes: - if 'notes' not in doc: - doc['notes'] = [] - doc['notes'].extend(notes) - - if 'options' not in fragment and 'logging_options' not in fragment and 'connection_options' not in fragment: - raise ValueError(f"missing options in fragment ({fragment_name}), possibly misformatted?: {filename}") - - for key, value in iteritems(fragment): - if key in doc: - # assumes both structures have same type - if isinstance(doc[key], MutableMapping): - value.update(doc[key]) - elif isinstance(doc[key], MutableSet): - value.add(doc[key]) - elif isinstance(doc[key], MutableSequence): - value = sorted(frozenset(value + doc[key])) - else: - raise TypeError(f"Attempt to extend a documentation fragement ({fragment_name}) of unknown type: {filename}") - doc[key] = value - - -def get_docstring(filename, verbose=False): - """ - DOCUMENTATION can be extended using documentation fragments loaded by the PluginLoader from the module_docs_fragments directory. - """ - - data = read_docstring(filename, verbose=verbose) - - # add fragments to documentation - if data.get('doc', False): - add_fragments(data['doc'], filename) - - return data['doc'], data['plainexamples'], data['returndocs'], data['metadata'] - - -def process_module(fname, template, outputname, aliases=None): - - module_name = fname.replace(".py", "") - - print_("Processing module %s" % (MODULEDIR + fname)) - doc, examples, returndocs, metadata = get_docstring(MODULEDIR + fname, - verbose=True) - - # add some defaults for plugins that dont have most of the info - doc['module'] = doc.get('module', module_name) - doc['version_added'] = doc.get('version_added', 'historical') - doc['plugin_type'] = 'module' - - required_fields = ('short_description',) - for field in required_fields: - if field not in doc: - print_("%s: WARNING: MODULE MISSING field '%s'" % (fname, field)) - - not_nullable_fields = ('short_description',) - for field in not_nullable_fields: - if field in doc and doc[field] in (None, ''): - print_("%s: WARNING: MODULE field '%s' DOCUMENTATION is null/empty value=%s" % - (fname, field, doc[field])) - - # - # The present template gets everything from doc so we spend most of this - # function moving data into doc for the template to reference - # - - if aliases: - doc['aliases'] = aliases - - # don't show version added information if it's too old to be called out - added = 0 - if doc['version_added'] == 'historical': - del doc['version_added'] - else: - added = doc['version_added'] - - # Strip old version_added for the module - if too_old(added): - del doc['version_added'] - - option_names = [] - if 'options' in doc and doc['options']: - for (k, v) in iteritems(doc['options']): - # Error out if there's no description - if 'description' not in doc['options'][k]: - raise AnsibleError( - "Missing required description for option %s in %s " % (k, module_name)) - - # Error out if required isn't a boolean (people have been putting - # information on when something is required in here. Those need - # to go in the description instead). - required_value = doc['options'][k].get('required', False) - if not isinstance(required_value, bool): - raise AnsibleError("Invalid required value '%s' for option '%s' in '%s' (must be truthy)" % ( - required_value, k, module_name)) - - # Strip old version_added information for options - if 'version_added' in doc['options'][k] and too_old(doc['options'][k]['version_added']): - del doc['options'][k]['version_added'] - - # Make sure description is a list of lines for later formatting - if not isinstance(doc['options'][k]['description'], list): - doc['options'][k]['description'] = [ - doc['options'][k]['description']] - option_names.append(k) - option_names.sort() - doc['option_keys'] = option_names - - connection_option_names = [] - if 'connection_options' in doc and doc['connection_options']: - for (k, v) in iteritems(doc['connection_options']): - # Error out if there's no description - if 'description' not in doc['connection_options'][k]: - raise AnsibleError( - "Missing required description for connection_option %s in %s " % (k, module_name)) - - # Error out if required isn't a boolean (people have been putting - # information on when something is required in here. Those need - # to go in the description instead). - required_value = doc['connection_options'][k].get( - 'required', False) - if not isinstance(required_value, bool): - raise AnsibleError("Invalid required value '%s' for connection_option '%s' in '%s' (must be truthy)" % - (required_value, k, module_name)) - - # Strip old version_added information for options - if ('version_added' in doc['connection_options'][k] and - too_old(doc['connection_options'][k]['version_added'])): - del doc['connection_options'][k]['version_added'] - - # Make sure description is a list of lines for later formatting - if not isinstance(doc['connection_options'][k]['description'], list): - doc['connection_options'][k]['description'] = [ - doc['connection_options'][k]['description']] - connection_option_names.append(k) - connection_option_names.sort() - doc['connection_option_keys'] = connection_option_names - - logging_option_names = [] - if 'logging_options' in doc and doc['logging_options']: - for (k, v) in iteritems(doc['logging_options']): - # Error out if there's no description - if 'description' not in doc['logging_options'][k]: - raise AnsibleError( - "Missing required description for logging_option %s in %s " % (k, module_name)) - - # Error out if required isn't a boolean (people have been putting - # information on when something is required in here. Those need - # to go in the description instead). - required_value = doc['logging_options'][k].get('required', False) - if not isinstance(required_value, bool): - raise AnsibleError("Invalid required value '%s' for logging_option '%s' in '%s' (must be truthy)" % - (required_value, k, module_name)) - - # Strip old version_added information for options - if ('version_added' in doc['logging_options'][k] and - too_old(doc['logging_options'][k]['version_added'])): - del doc['logging_options'][k]['version_added'] - - # Make sure description is a list of lines for later formatting - if not isinstance(doc['logging_options'][k]['description'], list): - doc['logging_options'][k]['description'] = [ - doc['logging_options'][k]['description']] - logging_option_names.append(k) - logging_option_names.sort() - doc['logging_option_keys'] = logging_option_names - - doc['filename'] = fname - doc['docuri'] = doc['module'].replace('_', '-') - doc['now_date'] = datetime.date.today().strftime('%Y-%m-%d') - doc['ansible_version'] = ansible_version - doc['plainexamples'] = examples # plain text - doc['metadata'] = metadata - - if returndocs: - try: - doc['returndocs'] = yaml.safe_load(returndocs) - returndocs_keys = list(doc['returndocs'].keys()) - returndocs_keys.sort() - doc['returndocs_keys'] = returndocs_keys - except Exception as e: - print_("%s:%s:yaml error:%s:returndocs=%s" % - (fname, module_name, e, returndocs)) - doc['returndocs'] = None - doc['returndocs_keys'] = None - else: - doc['returndocs'] = None - doc['returndocs_keys'] = None - - doc['author'] = doc.get('author', ['UNKNOWN']) - if isinstance(doc['author'], string_types): - doc['author'] = [doc['author']] - - # here is where we build the table of contents... - text = template.render(doc) - write_data(text, outputname, module_name, OUTPUTDIR) - -##################################################################################### - - -def main(): - - env, template, outputname = jinja2_environment('.', 'rst') - module_names = [] - - for module in os.listdir(MODULEDIR): - if module.startswith(MODULE_NAME_STARTS_WITH): - process_module(module, template, outputname) - module_names.append(module.replace(".py", "")) - - index_file_path = os.path.join(OUTPUTDIR, "index.rst") - with open(index_file_path, "w", encoding="UTF-8") as index_file: - index_file.write('Arista Cloudvision Ansible Modules\n') - index_file.write('==================================\n') - index_file.write('\n') - index_file.write('.. toctree::\n') - index_file.write(' :caption: Project Documentation\n') - index_file.write(' :name: mastertoc::\n') - index_file.write(' :maxdepth: 1\n') - index_file.write('\n') - index_file.write(' Collection Overview <../README.md>\n') - index_file.write('\n') - index_file.write('.. toctree::\n') - index_file.write(' :caption: Roles List\n') - index_file.write(' :name: roletoc::\n') - index_file.write(' :maxdepth: 1\n') - index_file.write('\n') - index_file.write( - ' DHCP Configuration <../ansible_collections/arista/cvp/roles/dhcp_configuration/README.md>\n') - index_file.write('\n') - index_file.write('.. toctree::\n') - index_file.write(' :caption: Modules List\n') - index_file.write(' :name: moduletoc::\n') - index_file.write(' :maxdepth: 1\n') - index_file.write('\n') - - for module_name in module_names: - index_file.write(' Module arista.cvp.%s <%s>\n' % (module_name, module_name)) - - -if __name__ == '__main__': - main() diff --git a/ansible_collections/arista/cvp/docs/_build/cv_change_control_v3.rst b/ansible_collections/arista/cvp/docs/_build/cv_change_control_v3.rst deleted file mode 100644 index 10752ab87..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_change_control_v3.rst +++ /dev/null @@ -1,210 +0,0 @@ -.. _cv_change_control_v3: - -cv_change_control_v3 -++++++++++++++++++++ -Change Control management with CloudVision - -Module added in version 3.4.0 - - - -.. contents:: - :local: - :depth: 2 - - -Synopsis --------- - - -CloudVision Portal Change Control Module. - - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
change
dictno -
A dict containing the change control to be created/modified
-
change_id
listno -
List of change IDs to get/remove
-
name
strno -
The name of the change control, If not provided, one will be generated automatically.
-
schedule_time
strno -
RFC3339 time format, e.g., 2021-12-23T02:07:00.0
-
state
strnoshow
  • show
  • set
  • remove
  • approve
  • unapprove
  • execute
  • schedule
  • approve_and_execute
  • schedule_and_approve
-
Set if we should get, set/update, or remove the change control
-
-
- -.. _cv_change_control_v3-examples-label: - -Examples: ---------- - -:: - - --- - - name: CVP Change Control Tests - hosts: cv_server - gather_facts: no - vars: - ansible_command_timeout: 1200 - ansible_connect_timeout: 600 - change: - name: Ansible playbook test change - notes: Created via playbook - activities: - - action: "Switch Healthcheck" - name: Switch1_healthcheck - arguments: - - name: DeviceID - value: - stage: Pre-Checks - - action: "Switch Healthcheck" - name: Switch2_healthcheck - arguments: - - name: DeviceID - value: - stage: Pre-Checks - - task_id: "20" - stage: Leaf1a_upgrade - - task_id: "22" - stage: Leaf1b_upgrade - stages: - - name: Pre-Checks - mode: parallel - - name: Upgrades - modes: series - - name: Leaf1a_upgrade - parent: Upgrades - - name: Leaf1b_upgrade - parent: Upgrades - - tasks: - - name: "Gather CVP change controls {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: show - register: cv_facts - - - name: "Print out all change controls from {{inventory_hostname}}" - debug: - msg: "{{cv_facts}}" - - - - name: "Check CC structure" - debug: - msg: "{{change}}" - - - - name: "Create a change control on {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: set - change: "{{ change }}" - register: cv_change_control - - - name: "Get the created change control {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: show - name: change.name - register: cv_facts - - - name: "Show the created CC from {{inventory_hostname}}" - debug: - msg: "{{cv_facts}}" - - - - name: "Delete the CC from {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: remove - name: "{{change.name}}" - register: cv_deleted - - - name: "Show deleted CCs" - debug: - msg: "{{cv_deleted}}" - - - name: "Approve a change control on {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: approve - change_id: ["{{ cv_change_control.data.id }}"] - - - name: "Execute a change control on {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: execute - change_id: ["{{ cv_change_control.data.id }}"] - - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) - - - -Full Schema -~~~~~~~~~~~ -Get full schema docs `here <../../schema/cv_change_control_v3/>`_. diff --git a/ansible_collections/arista/cvp/docs/_build/cv_configlet.rst b/ansible_collections/arista/cvp/docs/_build/cv_configlet.rst deleted file mode 100644 index da58de651..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_configlet.rst +++ /dev/null @@ -1,176 +0,0 @@ -.. _cv_configlet: - -cv_configlet -++++++++++++ -Create, Delete, or Update CloudVision Portal Configlets. - - -.. contents:: - :local: - :depth: 2 - -DEPRECATED ----------- - -:In: version: -:Why: Updated modules released with increased functionality -:Alternative: Use :ref:`arista.cvp.cv_configlet_v3 ` instead. - - - -Synopsis --------- - - -CloudVison Portal Configlet compares the list of configlets and config in -configlets against cvp-facts then adds, deletes, or updates -them as appropriate. -If a configlet is in cvp_facts but not in configlets it will be deleted. -If a configlet is in configlets but not in cvp_facts it will be created. -If a configlet is in both configlets and cvp_facts it configuration will -be compared and updated with the version in configlets -if the two are different. - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
configlet_filter
listno['none'] -
Filter to apply intended mode on a set of configlet. If not used, then module only uses ADD mode. configlet_filter list configlets that can be modified or deleted based on configlets entries.
-
configlets
dictyes -
List of configlets to managed on CVP server.
-
configlets_notes
strnoManaged by Ansible -
Add a note to the configlets.
-
cvp_facts
dictyes -
Facts extracted from CVP servers using cv_facts module
-
filter_mode
strnoloose
  • loose
  • strict
-
If loose, a match is when a configlet matches a substring of a configlet defined in the filter
-
If strict, a match is when a configlet exactly matches a configlet defined in the filter
-
options
dictno -
Implements the ability to create a sub-argument_spec, where the sub
-
options of the top level argument are also validated using
-
the attributes discussed in this section.
-
state
strnopresent
  • present
  • absent
-
If absent, configlets will be removed from CVP if they are not bound to either a container or a device.
-
If present, configlets will be created or updated.
-
-
- -.. _cv_configlet-examples-label: - -Examples: ---------- - -:: - - --- - - name: Test cv_configlet_v2 - hosts: cvp - connection: local - gather_facts: no - vars: - configlet_list: - Test_Configlet: "! This is a Very First Testing Configlet\n!" - Test_DYNAMIC_Configlet: "{{ lookup('file', 'templates/configlet_'+inventory_hostname+'.txt') }}" - tasks: - - name: 'Collecting facts from CVP {{inventory_hostname}}.' - tags: - - always - cv_facts: - register: cvp_facts - - - name: 'Create configlets on CVP {{inventory_hostname}}.' - tags: - - provision - cv_configlet: - cvp_facts: "{{cvp_facts.ansible_facts}}" - configlets: "{{configlet_list}}" - configlets_notes: "Configlet managed by Ansible" - configlet_filter: ["New", "Test","base-chk","base-firewall"] - register: cvp_configlet - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/cv_configlet_v3.rst b/ansible_collections/arista/cvp/docs/_build/cv_configlet_v3.rst deleted file mode 100644 index cf1180183..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_configlet_v3.rst +++ /dev/null @@ -1,117 +0,0 @@ -.. _cv_configlet_v3: - -cv_configlet_v3 -+++++++++++++++ -Create, Delete, or Update CloudVision Portal Configlets. - -Module added in version 3.0.0 - - - -.. contents:: - :local: - :depth: 2 - - -Synopsis --------- - - -CloudVison Portal Configlet compares the list of configlets and config in -configlets against cvp-facts then adds, deletes, or updates -them as appropriate. -If a configlet is in cvp_facts but not in configlets it will be deleted. -If a configlet is in configlets but not in cvp_facts it will be created. -If a configlet is in both configlets and cvp_facts it configuration will -be compared and updated with the version in configlets -if the two are different. - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
configlets
dictyes -
List of configlets to managed on CVP server.
-
configlets_notes
strnoManaged by Ansible -
Add a note to the configlets.
-
state
strnopresent
  • present
  • absent
-
If absent, configlets will be removed from CVP if they are not bound
-
to either a container or a device.
-
If present, configlets will be created or updated.
-
-
- -.. _cv_configlet_v3-examples-label: - -Examples: ---------- - -:: - - --- - - name: Test cv_configlet_v3 - hosts: cvp - connection: local - gather_facts: no - vars: - configlet_list: - Test_Configlet: "! This is a Very First Testing Configlet\n!" - Test_DYNAMIC_Configlet: "{{ lookup('file', 'templates/configlet_'+inventory_hostname+'.txt') }}" - tasks: - - name: 'Create configlets on CVP {{inventory_hostname}}.' - tags: - - provision - cv_configlet: - configlets: "{{configlet_list}}" - configlets_notes: "Configlet managed by Ansible" - register: cvp_configlet - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/cv_container.rst b/ansible_collections/arista/cvp/docs/_build/cv_container.rst deleted file mode 100644 index 97d4688b2..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_container.rst +++ /dev/null @@ -1,148 +0,0 @@ -.. _cv_container: - -cv_container -++++++++++++ -Manage Provisioning topology. - - -.. contents:: - :local: - :depth: 2 - -DEPRECATED ----------- - -:In: version: -:Why: Updated modules released with increased functionality -:Alternative: Use :ref:`arista.cvp.cv_container_v3 ` instead. - - - -Synopsis --------- - - -CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, to create and delete containers on CVP side. -Returns number of created and/or deleted containers - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
configlet_filter
listno['none'] -
Filter to apply intended set of configlet on containers. If not used, then module only uses ADD mode. configlet_filter list configlets that can be modified or deleted based on configlets entries.
-
cvp_facts
dictyes -
Facts from CVP collected by cv_facts module
-
mode
strnomerge
  • merge
  • override
  • delete
-
Allow to save topology or not
-
options
dictno -
Implements the ability to create a sub-argument_spec, where the sub
-
options of the top level argument are also validated using
-
the attributes discussed in this section.
-
topology
dictyes -
Yaml dictionary to describe intended containers
-
-
- -.. _cv_container-examples-label: - -Examples: ---------- - -:: - - - name: Create container topology on CVP - hosts: cvp - connection: local - gather_facts: no - vars: - verbose: False - containers: - Fabric: - parent_container: Tenant - Spines: - parent_container: Fabric - configlets: - - container_configlet - images: - - 4.22.0F - devices: - - veos01 - tasks: - - name: "Gather CVP facts {{inventory_hostname}}" - cv_facts: - register: cvp_facts - - name: "Build Container topology on {{inventory_hostname}}" - cv_container: - cvp_facts: "{{cvp_facts.ansible_facts}}" - topology: "{{containers}}" - mode: merge - register: CVP_CONTAINERS_RESULT - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/cv_container_v3.rst b/ansible_collections/arista/cvp/docs/_build/cv_container_v3.rst deleted file mode 100644 index c247d9b9b..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_container_v3.rst +++ /dev/null @@ -1,137 +0,0 @@ -.. _cv_container_v3: - -cv_container_v3 -+++++++++++++++ -Manage Provisioning topology. - -Module added in version 3.0.0 - - - -.. contents:: - :local: - :depth: 2 - - -Synopsis --------- - - -CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, to create and delete containers on CVP side. -Module also supports to configure configlets at container level. -Returns number of created and/or deleted containers - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
apply_mode
strnoloose
  • loose
  • strict
-
Set how configlets are attached/detached to containers. If set to strict all configlets not listed in your vars will be detached.
-
state
strnopresent
  • present
  • absent
-
Set if Ansible should build or remove devices on CloudVision
-
topology
dictyes -
YAML dictionary to describe intended containers
-
-
- -.. _cv_container_v3-examples-label: - -Examples: ---------- - -:: - - # task in loose mode (default) - - name: Create container topology on CVP - hosts: cvp - connection: local - gather_facts: no - vars: - verbose: False - containers: - Fabric: - parentContainerName: Tenant - Spines: - parentContainerName: Fabric - configlets: - - container_configlet - tasks: - - name: 'running cv_container' - arista.cvp.cv_container_v3: - topology: "{{CVP_CONTAINERS}}" - - # task in strict mode - - name: Create container topology on CVP - hosts: cvp - connection: local - gather_facts: no - vars: - verbose: False - containers: - Fabric: - parentContainerName: Tenant - Spines: - parentContainerName: Fabric - configlets: - - container_configlet - tasks: - - name: 'running cv_container' - arista.cvp.cv_container_v3: - topology: "{{CVP_CONTAINERS}}" - apply_mode: strict - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) - - - -Full Schema -~~~~~~~~~~~ -Get full schema docs `here <../../schema/cv_container_v3/>`_. diff --git a/ansible_collections/arista/cvp/docs/_build/cv_device.rst b/ansible_collections/arista/cvp/docs/_build/cv_device.rst deleted file mode 100644 index bf69b3678..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_device.rst +++ /dev/null @@ -1,185 +0,0 @@ -.. _cv_device: - -cv_device -+++++++++ -Provision, Reset, or Update CloudVision Portal Devices. - - -.. contents:: - :local: - :depth: 2 - -DEPRECATED ----------- - -:In: version: -:Why: Updated modules released with increased functionality -:Alternative: Use :ref:`arista.cvp.cv_device_v3 ` instead. - - - -Synopsis --------- - - -CloudVision Portal Device compares the list of Devices -in devices against cvp-facts then adds, resets, or updates them as appropriate. -If a device is in cvp_facts but not in devices it will be reset to factory defaults in ZTP mode -If a device is in devices but not in cvp_facts it will be provisioned -If a device is in both devices and cvp_facts its configlets and imageBundles will be compared -and updated with the version in devices if the two are different. -Warning - reset means devices will be erased and will run full ZTP process. Use this function with caution ! - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
configlet_mode
strnooverride
  • override
  • merge
  • delete
-
If override, Add listed configlets and remove all unlisted ones.
-
If merge, Add listed configlets to device and do not touch already configured configlets.
-
cvp_facts
dictyes -
Facts from CVP collected by cv_facts module
-
device_filter
listno['all'] -
Filter to apply intended mode on a set of configlet. If not used, then module only uses ADD mode. device_filter list devices that can be modified or deleted based on configlets entries.
-
devices
dictyes -
Yaml dictionary to describe intended devices configuration from CVP stand point.
-
options
dictno -
Implements the ability to create a sub-argument_spec, where the sub
-
options of the top level argument are also validated using
-
the attributes discussed in this section.
-
state
strnopresent
  • present
  • absent
-
If absent, devices will be removed from CVP and moved back to undefined.
-
If present, devices will be configured or updated.
-
-
- -.. _cv_device-examples-label: - -Examples: ---------- - -:: - - --- - - name: Test cv_device - hosts: cvp - connection: local - gather_facts: no - collections: - - arista.cvp - vars: - configlet_list: - cv_device_test01: "alias a{{ 999 | random }} show version" - cv_device_test02: "alias a{{ 999 | random }} show version" - # Device inventory for provision activity: bind configlet - devices_inventory: - veos01: - name: veos01 - configlets: - - cv_device_test01 - - SYS_TelemetryBuilderV2_172.23.0.2_1 - - veos01-basic-configuration - - SYS_TelemetryBuilderV2 - tasks: - # Collect CVP Facts as init process - - name: "Gather CVP facts from {{inventory_hostname}}" - cv_facts: - register: cvp_facts - tags: - - always - - - name: "Configure devices on {{inventory_hostname}}" - tags: - - provision - cv_device: - devices: "{{devices_inventory}}" - cvp_facts: '{{cvp_facts.ansible_facts}}' - device_filter: ['veos'] - register: cvp_device - - - name: "Add configlet to device on {{inventory_hostname}}" - tags: - - provision - cv_device: - devices: "{{devices_inventory}}" - cvp_facts: '{{cvp_facts.ansible_facts}}' - configlet_mode: merge - device_filter: ['veos'] - register: cvp_device - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/cv_device_v3.rst b/ansible_collections/arista/cvp/docs/_build/cv_device_v3.rst deleted file mode 100644 index db03779b0..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_device_v3.rst +++ /dev/null @@ -1,215 +0,0 @@ -.. _cv_device_v3: - -cv_device_v3 -++++++++++++ -Manage Provisioning topology. - -Module added in version 3.0.0 - - - -.. contents:: - :local: - :depth: 2 - - -Synopsis --------- - - -CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, to create and delete containers on CVP side. -Returns number of created and/or deleted containers - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
apply_mode
strnoloose
  • loose
  • strict
-
Set how configlets are attached/detached on device. If set to strict, all configlets and image bundles not listed in your vars are detached.
-
devices
listyes -
List of devices with their container, configlet, and image bundle information
-
search_key
strnohostname
  • fqdn
  • hostname
  • serialNumber
-
Key name to use to look for device in CloudVision.
-
state
strnopresent
  • present
  • factory_reset
  • provisioning_reset
  • absent
-
Set if Ansible should build, remove devices from provisioning, fully decommission or factory reset devices on CloudVision
-
-
- -.. _cv_device_v3-examples-label: - -Examples: ---------- - -:: - - # task in loose mode using fqdn (default) - - name: Device Management in CloudVision - hosts: cv_server - connection: local - gather_facts: false - collections: - - arista.cvp - vars: - CVP_DEVICES: - - fqdn: CV-ANSIBLE-EOS01 - parentContainerName: ANSIBLE - configlets: - - 'CV-EOS-ANSIBLE01' - imageBundle: leaf_image_bundle - tasks: - - name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: present - search_key: fqdn - - # task in loose mode using serial - - name: Device Management in CloudVision - hosts: cv_server - connection: local - gather_facts: false - collections: - - arista.cvp - vars: - CVP_DEVICES: - - serialNumber: xxxxxxxxxxxx - parentContainerName: ANSIBLE - configlets: - - 'CV-EOS-ANSIBLE01' - tasks: - - name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: present - search_key: serialNumber - - # task in strict mode - - name: Device Management in CloudVision - hosts: cv_server - connection: local - gather_facts: false - collections: - - arista.cvp - vars: - CVP_DEVICES: - - fqdn: CV-ANSIBLE-EOS01 - parentContainerName: ANSIBLE - configlets: - - 'CV-EOS-ANSIBLE01' - tasks: - - name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: present - apply_mode: strict - - # Decommission devices (remove from both provisioning and telemetry) - - name: Decommission device - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - fqdn: leaf1 - parentContainerName: "" - tasks: - - name: decommission device - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: absent - - # Remove a device from provisioning - # Post 2021.3.0 the device will be automatically re-registered and moved to the Undefined container - - name: Remove device - hosts: CVP - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - fqdn: leaf2 - parentContainerName: "" - tasks: - - name: remove device - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: provisioning_reset - - # Factory reset a device (moves the device to ZTP mode) - - name: Factory reset device - hosts: CVP - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - fqdn: leaf2 - parentContainerName: "" - tasks: - - name: remove device - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: factory_reset - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) - - - -Full Schema -~~~~~~~~~~~ -Get full schema docs `here <../../schema/cv_device_v3/>`_. diff --git a/ansible_collections/arista/cvp/docs/_build/cv_facts.rst b/ansible_collections/arista/cvp/docs/_build/cv_facts.rst deleted file mode 100644 index ccdf6ebfc..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_facts.rst +++ /dev/null @@ -1,123 +0,0 @@ -.. _cv_facts: - -cv_facts -++++++++ -Collect facts from CloudVision Portal. - - -.. contents:: - :local: - :depth: 2 - -DEPRECATED ----------- - -:In: version: -:Why: Features are now part of every single v3 modules. -:Alternative: Currently no alternative. - - - -Synopsis --------- - - -Returns list of devices, configlets, containers and images - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
facts
listno['all']
  • all
  • devices
  • containers
  • configlets
  • tasks
-
List of facts to retrieve from CVP.
-
By default, cv_facts returns facts for devices/configlets/containers/tasks
-
Using this parameter allows user to limit scope to a subset of information.
-
gather_subset
listno['default']
  • default
  • config
  • tasks_pending
  • tasks_failed
  • tasks_all
-
When supplied, this argument will restrict the facts collected
-
to a given subset. Possible values for this argument include
-
all, hardware, config, and interfaces. Can specify a list of
-
values to include a larger subset. Values can also be used
-
with an initial ! to specify that a specific subset should
-
not be collected.
-
-
- -.. _cv_facts-examples-label: - -Examples: ---------- - -:: - - --- - tasks: - - name: '#01 - Collect devices facts from {{inventory_hostname}}' - cv_facts: - facts: - devices - register: FACTS_DEVICES - - - name: '#02 - Collect devices facts (with config) from {{inventory_hostname}}' - cv_facts: - gather_subset: - config - facts: - devices - register: FACTS_DEVICES_CONFIG - - - name: '#03 - Collect confilgets facts from {{inventory_hostname}}' - cv_facts: - facts: - configlets - register: FACTS_CONFIGLETS - - - name: '#04 - Collect containers facts from {{inventory_hostname}}' - cv_facts: - facts: - containers - register: FACTS_CONTAINERS - - - name: '#10 - Collect ALL facts from {{inventory_hostname}}' - cv_facts: - register: FACTS - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/cv_facts_v3.rst b/ansible_collections/arista/cvp/docs/_build/cv_facts_v3.rst deleted file mode 100644 index 49220da20..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_facts_v3.rst +++ /dev/null @@ -1,139 +0,0 @@ -.. _cv_facts_v3: - -cv_facts_v3 -+++++++++++ -Collect facts from CloudVision - -Module added in version 3.3.0 - - - -.. contents:: - :local: - :depth: 2 - - -Synopsis --------- - - -Returns list of devices, configlets, containers, images and tasks from CloudVision - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
facts
listno['configlets', 'containers', 'devices', 'images', 'tasks']
  • configlets
  • containers
  • devices
  • images
  • tasks
-
List of facts to retrieve from CVP.
-
By default, cv_facts returns facts for devices/configlets/containers/images/tasks
-
Using this parameter allows user to limit scope to a subset of information.
-
regexp_filter
strno.* -
Regular Expression to filter configlets, devices and tasks in facts
-
verbose
strnoshort
  • long
  • short
-
get all data from CV or get only cv_modules data
-
-
- -.. _cv_facts_v3-examples-label: - -Examples: ---------- - -:: - - tasks: - - name: '#01 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - - - name: '#02 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - configlets - register: FACTS_DEVICES - - - name: '#03 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - devices - - containers - register: FACTS_DEVICES - - - name: '#04 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - devices - regexp_filter: "spine1" - verbose: long - register: FACTS_DEVICES - - - name: '#05 - Collect images facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - images - register: FACTS_DEVICES - - - name: '#06 - Collect task facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - tasks - regexp_filter: 'Pending' # get facts filtered by task status - 'Failed', 'Pending', 'Completed', 'Cancelled' - verbose: 'long' - register: FACTS_DEVICES - - - name: '#07 - Collect task facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - tasks - regexp_filter: 95 # get facts filtered by task_Id (int) - verbose: 'long' - register: FACTS_DEVICES - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/cv_image_v3.rst b/ansible_collections/arista/cvp/docs/_build/cv_image_v3.rst deleted file mode 100644 index bf1984d23..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_image_v3.rst +++ /dev/null @@ -1,155 +0,0 @@ -.. _cv_image_v3: - -cv_image_v3 -+++++++++++ -EOS Image management with CloudVision - -Module added in version 3.3.0 - - - -.. contents:: - :local: - :depth: 2 - - -Synopsis --------- - - -CloudVision Portal Image management module. - -Due to a current limitation in CloudVision API, -authentication with token is not supported for this module only. - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
action
strnoget
  • get
  • add
  • remove
-
Action to do with module
-
bundle_name
strno -
Name of the bundle to manage
-
image
strno -
Name of the image file, including path if needed
-
image_list
listno -
List of name of the image file, including path if needed
-
mode
strnoimage
  • bundle
  • image
-
What to manage with module
-
-
- -.. _cv_image_v3-examples-label: - -Examples: ---------- - -:: - - --- - - name: CVP Image Tests - hosts: cv_server - gather_facts: no - vars: - tasks: - - name: "Gather CVP image information facts {{inventory_hostname}}" - arista.cvp.cv_image_v3: - mode: image - action: get - register: image_data - - - name: "Print out facts from {{inventory_hostname}}" - debug: - msg: "{{image_data}}" - - - - name: "Get CVP image image bundles {{inventory_hostname}}" - arista.cvp.cv_image_v3: - mode: bundle - action: get - register: image_bundle_data - - - name: "Print out images from {{inventory_hostname}}" - debug: - msg: "{{image_bundle_data}}" - - - - name: "Update an image bundle {{inventory_hostname}}" - vars: - ansible_command_timeout: 1200 - ansible_connect_timeout: 600 - arista.cvp.cv_image_v3: - mode: bundle - action: add - bundle_name: Test_bundle - image_list: - - TerminAttr-1.16.4-1.swix - - EOS-4.25.4M.swi - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/cv_tag_v3.rst b/ansible_collections/arista/cvp/docs/_build/cv_tag_v3.rst deleted file mode 100644 index c21e54519..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_tag_v3.rst +++ /dev/null @@ -1,240 +0,0 @@ -.. _cv_tag_v3: - -cv_tag_v3 -+++++++++ -Create/Assign/Delete/Unassign tags on CVP - -Module added in version 3.4.0 - - - -.. contents:: - :local: - :depth: 2 - - -Synopsis --------- - - -CloudVision Portal Tag module to Create/Assign/Delete/Unassign tags on CloudVision - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
auto_create
boolnoTrue
  • yes
  • no
-
auto_create tags before assigning
-
mode
strno
  • create
  • delete
  • assign
  • unassign
-
action to carry out on the tags create - create tags delete - delete tags assign - assign existing tags to device unassign - unassign existing tags from device
-
tags
listyes -
CVP tags
-
-
- -.. _cv_tag_v3-examples-label: - -Examples: ---------- - -:: - - # Create and assign device and interface tags to multiple devices and interfaces - - name: cv_tag_v3 example1 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - - name: tag3 - value: value3 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - - name: tag2i - value: value2i - - interface: Ethernet2 - tags: - - name: tag1i - value: value1i - - name: tag2i - value: value2i - - device: spine1 - device_tags: - - name: DC - value: Dublin - - name: rack - value: rackA - - name: pod - value: podA - interface_tags: - - interface: Ethernet3 - tags: - - name: tag3i - value: value3i - - name: tag4i - value: value4i - - interface: Ethernet4 - tags: - - name: tag5i - value: value6i - - name: tag6i - value: value6i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: assign - auto_create: true - - # Delete device and interface tags - - name: cv_tag_v3 example2 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: delete - - # Create device and interface tags (without assigning to the devices) - - name: cv_tag_v3 example3 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: create - - # Assign device and interface tags - - name: cv_tag_v3 example4 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: assign - - # Unassign device and interface tags - - name: cv_tag_v3 example5 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: assign - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) - - - -Full Schema -~~~~~~~~~~~ -Get full schema docs `here <../../schema/cv_tag_v3/>`_. diff --git a/ansible_collections/arista/cvp/docs/_build/cv_task.rst b/ansible_collections/arista/cvp/docs/_build/cv_task.rst deleted file mode 100644 index d709d32eb..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_task.rst +++ /dev/null @@ -1,129 +0,0 @@ -.. _cv_task: - -cv_task -+++++++ -Execute or Cancel CVP Tasks. - - -.. contents:: - :local: - :depth: 2 - -DEPRECATED ----------- - -:In: version: -:Why: Updated modules released with increased functionality -:Alternative: Use :ref:`arista.cvp.cv_task_v3 ` instead. - - - -Synopsis --------- - - -CloudVision Portal Task module - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
options
dictno -
Implements the ability to create a sub-argument_spec, where the sub
-
options of the top level argument are also validated using
-
the attributes discussed in this section.
-
state
strnoexecuted
  • executed
  • cancelled
-
action to carry out on the task executed - execute tasks cancelled - cancel tasks
-
tasks
listyes -
CVP taskIDs to act on
-
wait
intno0 -
Time to wait for tasks to transition to 'Completed'
-
-
- -.. _cv_task-examples-label: - -Examples: ---------- - -:: - - --- - - name: Execute all tasks registered in cvp_configlets variable - arista.cvp.cv_task: - tasks: "{{ cvp_configlets.data.tasks }}" - - - name: Cancel a list of pending tasks - arista.cvp.cv_task: - tasks: "{{ cvp_configlets.data.tasks }}" - state: cancelled - - # Execute all pending tasks and wait for completion for 60 seconds - # In order to get a list of all pending tasks, execute cv_facts first - - name: Update cvp facts - arista.cvp.cv_facts: - - - name: Execute all pending tasks and wait for completion for 60 seconds - arista.cvp.cv_task: - port: '{{cvp_port}}' - tasks: "{{ tasks }}" - wait: 60 - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/cv_task_v3.rst b/ansible_collections/arista/cvp/docs/_build/cv_task_v3.rst deleted file mode 100644 index f16c748b1..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_task_v3.rst +++ /dev/null @@ -1,89 +0,0 @@ -.. _cv_task_v3: - -cv_task_v3 -++++++++++ -Execute or Cancel CVP Tasks. - -Module added in version 3.0.0 - - - -.. contents:: - :local: - :depth: 2 - - -Synopsis --------- - - -CloudVision Portal Task module to action pending tasks on CloudVision - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
state
strnoexecuted
  • executed
  • cancelled
-
action to carry out on the task executed - execute tasks cancelled - cancel tasks
-
tasks
listyes -
CVP taskIDs to act on
-
-
- -.. _cv_task_v3-examples-label: - -Examples: ---------- - -:: - - --- - - name: Execute all tasks registered in cvp_configlets variable - arista.cvp.cv_task: - tasks: "{{ cvp_configlets.taskIds }}" - - - name: Cancel a list of pending tasks - arista.cvp.cv_task: - tasks: ['666', '667'] - state: cancelled - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/cv_validate_v3.rst b/ansible_collections/arista/cvp/docs/_build/cv_validate_v3.rst deleted file mode 100644 index 781ba9271..000000000 --- a/ansible_collections/arista/cvp/docs/_build/cv_validate_v3.rst +++ /dev/null @@ -1,117 +0,0 @@ -.. _cv_validate_v3: - -cv_validate_v3 -++++++++++++++ -CVP/Local configlet Validation - -Module added in version 3.7.0 - - - -.. contents:: - :local: - :depth: 2 - - -Synopsis --------- - - -CloudVision Portal Validate module to Validate configlets against a device on CVP. - - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
devices
listyes -
CVP devices and configlet information.
-
validate_mode
stryes
  • stop_on_error
  • stop_on_warning
  • ignore
-
Indicate how cv_validate_v3 should behave on finding errors and/or warnings.
-
-
- -.. _cv_validate_v3-examples-label: - -Examples: ---------- - -:: - - # offline validation - - name: offline configlet validation - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - device_name: leaf1 - search_type: hostname #[hostname | serialNumber | fqdn] - local_configlets: - valid: "interface Ethernet1\n description test_validate" - error: "ruter bgp 1111\n neighbor 1.1.1.1 remote-bs 111" - - tasks: - - name: validate module - arista.cvp.cv_validate_v3: - devices: "{{CVP_DEVICES}}" - validate_mode: stop_on_error # | stop_on_warning | valid - - # online validation - - name: Online configlet validation - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - device_name: leaf1.aristanetworks.com - search_type: fqdn #[hostname | serialNumber | fqdn] - cvp_configlets: - - valid - - invalid - - tasks: - - name: validate module - arista.cvp.cv_validate_v3: - devices: "{{CVP_DEVICES}}" - validate_mode: stop_on_error # | stop_on_warning | valid - - - -Author -~~~~~~ - -* Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/_build/index.rst b/ansible_collections/arista/cvp/docs/_build/index.rst deleted file mode 100644 index 6dc65c953..000000000 --- a/ansible_collections/arista/cvp/docs/_build/index.rst +++ /dev/null @@ -1,36 +0,0 @@ -Arista Cloudvision Ansible Modules -================================== - -.. toctree:: - :caption: Project Documentation - :name: mastertoc:: - :maxdepth: 1 - - Collection Overview <../README.md> - -.. toctree:: - :caption: Roles List - :name: roletoc:: - :maxdepth: 1 - - DHCP Configuration <../ansible_collections/arista/cvp/roles/dhcp_configuration/README.md> - -.. toctree:: - :caption: Modules List - :name: moduletoc:: - :maxdepth: 1 - - Module arista.cvp.cv_configlet - Module arista.cvp.cv_facts - Module arista.cvp.cv_container - Module arista.cvp.cv_configlet_v3 - Module arista.cvp.cv_task_v3 - Module arista.cvp.cv_image_v3 - Module arista.cvp.cv_task - Module arista.cvp.cv_change_control_v3 - Module arista.cvp.cv_tag_v3 - Module arista.cvp.cv_facts_v3 - Module arista.cvp.cv_validate_v3 - Module arista.cvp.cv_device_v3 - Module arista.cvp.cv_container_v3 - Module arista.cvp.cv_device diff --git a/ansible_collections/arista/cvp/docs/_build/rst.j2 b/ansible_collections/arista/cvp/docs/_build/rst.j2 deleted file mode 100644 index f66816948..000000000 --- a/ansible_collections/arista/cvp/docs/_build/rst.j2 +++ /dev/null @@ -1,562 +0,0 @@ -.. _@{ module }@: - -{% set title = module %} -{% set title_len = title|length %} -@{ title }@ -@{ '+' * title_len }@ -{% if short_description %} -@{ short_description|convert_symbols_to_format }@ -{% endif %} - -{% if version_added is defined and version_added != '' -%} -Module added in version @{ version_added | default('') }@ - - -{% endif %} - -.. contents:: - :local: - :depth: 2 - -{# ------------------------------------------ - # - # Please note: this looks like a core dump - # but it isn't one. - # - --------------------------------------------#} -{% if deprecated is defined -%} - - -DEPRECATED ----------- - -{# use unknown here? skip the fields? #} -:In: version: @{ deprecated['version'] | default('') | string | convert_symbols_to_format }@ -:Why: @{ deprecated['why'] | default('') | convert_symbols_to_format }@ -:Alternative: @{ deprecated['alternative'] | default('')| convert_symbols_to_format }@ - - -{% endif %} - -Synopsis --------- - -{% if description %} - -{% for desc in description -%} -@{ desc | convert_symbols_to_format }@ -{% endfor %} - - -{% endif %} -{% if aliases is defined -%} - -Aliases: @{ ','.join(aliases) }@ - - -{% endif %} -{% if requirements %} - -Requirements ------------- -The following software packages must be installed on hosts that execute this module: - -{% for req in requirements %} -* @{ req | convert_symbols_to_format }@ -{% endfor %} - - - -{% endif %} -{% if options -%} - -.. _module-specific-options-label: - -Module-specific Options ------------------------ -The following options may be specified for this module: - -.. raw:: html - - - - - - - - - - - -{% for k in option_keys -%} -{% set v = options[k] -%} -{% if not v['suboptions'] %} - - - - - - -{% if v.get('type', 'not_bool') == 'bool' %} - -{% else %} - -{% endif %} - - - - - - - - - - - -{% endif %} - - -{% endfor %} - -
parametertyperequireddefaultchoicescomments
@{ k }@
{% if v['version_added'] -%} (added in @{v['version_added']}@){% endif -%}
{% if v['type'] -%}@{ v['type'] }@{% endif -%}{% if v.get('required', False) -%}yes{% else %}no{% endif -%}{% if v.get('default', None) is not none -%}@{ v['default'] | string | html_ify }@{% endif -%}
  • yes
  • no
{% if v['choices'] -%}
    {% for choice in v.get('choices',[]) -%}
  • @{ choice }@
  • {% endfor -%}
{% endif -%}
-{% if v.description is string %} -
@{ v.description | replace('\n', '\n ') | html_ify }@
-{% else %} -{% for desc in v.description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% endif %} -{% if 'aliases' in v and v.aliases %} -
aliases: @{ v.aliases|join(', ') }@
-{% endif %} -{% else %} - -
@{ k }@
{% if v['version_added'] -%} (added in @{v['version_added']}@){% endif -%}
{% if v['type'] -%}@{ v['type'] }@{% endif -%}{% if v.get('required', False) -%}yes{% else -%}no{% endif -%} -{% for desc in v.description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% if 'aliases' in v and v.aliases %} -
aliases: @{ v.aliases|join(', ') }@
-{% endif %} -
- - - - - - - - - - - -{% for k2 in v['suboptions'] %} -{% set v2 = v['suboptions'] [k2] %} - - - - - - -{% if v2.get('type', 'not_bool') == 'bool' %} - -{% else %} - -{% endif %} - - -{% endfor %} - -
Dictionary object @{ k }@
parametertyperequireddefaultchoicescomments
@{ k2 }@
{% if v2['version_added'] -%} (added in @{v2['version_added']}@){% endif -%}
{% if v2['type'] -%}@{ v2['type'] }@{% endif -%}{% if v2.get('required', False) -%}yes{% else -%}no{% endif -%}{% if v2.get('default', None) is not none -%}@{ v2['default'] | string | html_ify }@{% endif -%}
  • yes
  • no
{% if v2['choices'] -%}
    {% for choice in v2.get('choices',[]) -%}
  • @{ choice }@
  • {% endfor -%}
{% endif -%}
-{% if v2.description is string %} -
@{ v2.description | replace('\n', '\n ') | html_ify }@
-{% else %} -{% for desc in v2.description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% endif %} -{% if 'aliases' in v and v2.aliases %} -
aliases: @{ v2.aliases|join(', ') }@
-{% endif %} -
- -
-
- -{% endif %} -{% if connection_options -%} - - -Common Connection-related Options ---------------------------------- -In addition to the :ref:`module-specific-options-label`, the following connection-related options are also supported by this module: - -.. raw:: html - - - - - - - - - - - -{% for k in connection_option_keys -%} -{% set v = connection_options[k] -%} -{% if not v['suboptions'] %} - - - - - - -{% if v.get('type', 'not_bool') == 'bool' %} - -{% else %} - -{% endif %} - - - - - - - - - - - -{% endif %} - - -{% endfor %} - -
parametertyperequireddefaultchoicescomments
@{ k }@
{% if v['version_added'] -%} (added in @{v['version_added']}@){% endif -%}
{% if v['type'] -%}@{ v['type'] }@{% endif -%}{% if v.get('required', False) -%}yes{% else %}no{% endif -%}{% if v.get('default', None) is not none -%}@{ v['default'] | string | html_ify }@{% endif -%}
  • yes
  • no
{% if v['choices'] -%}
    {% for choice in v.get('choices',[]) -%}
  • @{ choice }@
  • {% endfor -%}
{% endif -%}
-{% if v.description is string %} -
@{ v.description | replace('\n', '\n ') | html_ify }@
-{% else %} -{% for desc in v.description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% endif %} -{% if 'aliases' in v and v.aliases %} -
aliases: @{ v.aliases|join(', ') }@
-{% endif %} -{% else %} - -
@{ k }@
{% if v['version_added'] -%} (added in @{v['version_added']}@){% endif -%}
{% if v['type'] -%}@{ v['type'] }@{% endif -%}{% if v.get('required', False) -%}yes{% else -%}no{% endif -%} -{% for desc in v.description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% if 'aliases' in v and v.aliases %} -
aliases: @{ v.aliases|join(', ') }@
-{% endif %} -
- - - - - - - - - - - -{% for k2 in v['suboptions'] %} -{% set v2 = v['suboptions'] [k2] %} - - - - - - -{% if v2.get('type', 'not_bool') == 'bool' %} - -{% else %} - -{% endif %} - - -{% endfor %} - -
Dictionary object @{ k }@
parametertyperequireddefaultchoicescomments
@{ k2 }@
{% if v2['version_added'] -%} (added in @{v2['version_added']}@){% endif -%}
{% if v2['type'] -%}@{ v2['type'] }@{% endif -%}{% if v2.get('required', False) -%}yes{% else -%}no{% endif -%}{% if v2.get('default', None) is not none -%}@{ v2['default'] | string | html_ify }@{% endif -%}
  • yes
  • no
{% if v2['choices'] -%}
    {% for choice in v2.get('choices',[]) -%}
  • @{ choice }@
  • {% endfor -%}
{% endif -%}
-{% if v2.description is string %} -
@{ v2.description | replace('\n', '\n ') | html_ify }@
-{% else %} -{% for desc in v2.description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% endif %} -{% if 'aliases' in v and v2.aliases %} -
aliases: @{ v2.aliases|join(', ') }@
-{% endif %} -
- -
-
- -{% endif %} -{% if logging_options -%} - - -Common Logging-related Options ------------------------------- -In addition to the :ref:`module-specific-options-label`, the following logging-related options are also supported by this module: - -.. raw:: html - - - - - - - - - - - -{% for k in logging_option_keys -%} -{% set v = logging_options[k] -%} -{% if not v['suboptions'] %} - - - - - - -{% if v.get('type', 'not_bool') == 'bool' %} - -{% else %} - -{% endif %} - - - - - - - - - - - -{% endif %} - - -{% endfor %} - -
parametertyperequireddefaultchoicescomments
@{ k }@
{% if v['version_added'] -%} (added in @{v['version_added']}@){% endif -%}
{% if v['type'] -%}@{ v['type'] }@{% endif -%}{% if v.get('required', False) -%}yes{% else %}no{% endif -%}{% if v.get('default', None) is not none -%}@{ v['default'] | string | html_ify }@{% endif -%}
  • yes
  • no
{% if v['choices'] -%}
    {% for choice in v.get('choices',[]) -%}
  • @{ choice }@
  • {% endfor -%}
{% endif -%}
-{% if v.description is string %} -
@{ v.description | replace('\n', '\n ') | html_ify }@
-{% else %} -{% for desc in v.description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% endif %} -{% if 'aliases' in v and v.aliases %} -
aliases: @{ v.aliases|join(', ') }@
-{% endif %} -{% else %} - -
@{ k }@
{% if v['version_added'] -%} (added in @{v['version_added']}@){% endif -%}
{% if v['type'] -%}@{ v['type'] }@{% endif -%}{% if v.get('required', False) -%}yes{% else -%}no{% endif -%} -{% for desc in v.description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% if 'aliases' in v and v.aliases %} -
aliases: @{ v.aliases|join(', ') }@
-{% endif %} -
- - - - - - - - - - - -{% for k2 in v['suboptions'] %} -{% set v2 = v['suboptions'] [k2] %} - - - - - - -{% if v2.get('type', 'not_bool') == 'bool' %} - -{% else %} - -{% endif %} - - -{% endfor %} - -
Dictionary object @{ k }@
parametertyperequireddefaultchoicescomments
@{ k2 }@
{% if v2['version_added'] -%} (added in @{v2['version_added']}@){% endif -%}
{% if v2['type'] -%}@{ v2['type'] }@{% endif -%}{% if v2.get('required', False) -%}yes{% else -%}no{% endif -%}{% if v2.get('default', None) is not none -%}@{ v2['default'] | string | html_ify }@{% endif -%}
  • yes
  • no
{% if v2['choices'] -%}
    {% for choice in v2.get('choices',[]) -%}
  • @{ choice }@
  • {% endfor -%}
{% endif -%}
-{% if v2.description is string %} -
@{ v2.description | replace('\n', '\n ') | html_ify }@
-{% else %} -{% for desc in v2.description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% endif %} -{% if 'aliases' in v and v2.aliases %} -
aliases: @{ v2.aliases|join(', ') }@
-{% endif %} -
- -
-
- -{% endif %} -{% if examples or plainexamples -%} -.. _@{ title }@-examples-label: - -Examples: ---------- - -:: -{% for example in examples %} -{% if example['description'] %} -@{ example['description'] }@ -{% endif %} -@{ example['code'] | escape | indent(4, True) }@ -{% endfor %} -{% if plainexamples %} -@{ plainexamples | indent(4, True) }@ -{% endif %} -{% endif %} -{% if returndocs -%} - - -Return Values -------------- - -.. raw:: html - - - - - - - - - - - -{% for entry in returndocs_keys %} - - - - - - - - -{% if returndocs[entry].type == 'complex' %} - - - - - -{% endif %} -{% endfor %} - -
namedescriptionreturnedtypesample
@{ entry }@ -{% if returndocs[entry].description is string %} -
@{ returndocs[entry].description | replace('\n', '\n ') | html_ify }@
-{% else %} -{% for desc in returndocs[entry].description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% endif %} -
@{ returndocs[entry].returned | html_ify }@@{ returndocs[entry].type | html_ify }@@{ returndocs[entry].sample | replace('\n', '\n ') | html_ify }@
contains: - - - - - - - - - -{% for sub in returndocs[entry].contains %} - - - - - - - - -{% endfor %} - -
namedescriptionreturnedtypesample
@{ sub }@ -{% if returndocs[entry].contains[sub].description is string %} -
@{ returndocs[entry].contains[sub].description | replace('\n', '\n ') | html_ify }@
-{% else %} -{% for desc in returndocs[entry].contains[sub].description %} -
@{ desc | replace('\n', '\n ') | html_ify }@
-{% endfor %} -{% endif %} -
@{ returndocs[entry].contains[sub].returned | html_ify }@@{ returndocs[entry].contains[sub].type | html_ify }@@{ returndocs[entry].contains[sub].sample }@
-
-
-
-{% endif %} - - -{% if notes -%} - - -Notes ------ - -.. note:: -{% for note in notes %} - - @{ note | convert_symbols_to_format }@ -{% endfor %} - - -{% endif %} -{% if author is defined -%} - - -Author -~~~~~~ - -{% for author_name in author %} -* @{ author_name }@ -{% endfor %} - - -{% endif %} -{% if not deprecated %} -{% set support = { 'core': 'The Ansible Core Team', 'network': 'The Ansible Network Team', 'certified': 'an Ansible Partner', 'community': 'The Ansible Community', 'curated': 'A Third Party'} %} -{% set module_states = { 'preview': 'it is not guaranteed to have a backwards compatible interface', 'stableinterface': 'the maintainers for this module guarantee that no backward incompatible interface changes will be made'} %} -{% if metadata %} -{% if metadata.status %} - - -Status -~~~~~~ - -{% for cur_state in metadata.status %} -This module is flagged as **@{cur_state}@** which means that @{module_states[cur_state]}@. -{% endfor %} - - -{% endif %} -{% endif %} -{% endif %} - -{% if 'cv_change_control_v3' in module or 'cv_container_v3' in module or 'cv_device_v3' in module or 'cv_tag_v3' in module %} -Full Schema -~~~~~~~~~~~ -Get full schema docs `here <../../schema/@{ module }@/>`_. -{% endif %} diff --git a/ansible_collections/arista/cvp/docs/build-md/doc.py b/ansible_collections/arista/cvp/docs/build-md/doc.py new file mode 100644 index 000000000..5465c9767 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/build-md/doc.py @@ -0,0 +1,43 @@ +import os +from pathlib import Path + +from ansible.parsing.plugin_docs import read_docstring +from jinja2 import Environment, FileSystemLoader + +MODULE_NAME_STARTS_WITH = "cv_" +MODULEDIR = "../../plugins/modules/" +OUTPUTDIR = "../modules" + + +def jinja2_writer(template_dir, name, data): + env = Environment( + loader=FileSystemLoader(template_dir), + trim_blocks=True, + ) + + template = env.get_template("md.j2") + name = name.removesuffix(".py") + filename = f"{name}.md" + + content = template.render( + module=data, + name=name, + ) + with open(os.path.join(OUTPUTDIR, filename), mode="w", encoding="utf-8") as file: + file.write(content) + print(f"{filename} saved") + + return env, template + + +def main(): + for module in os.listdir(MODULEDIR): + if module.startswith(MODULE_NAME_STARTS_WITH): + file = os.path.join(MODULEDIR, module) + if Path(file).is_file(): + data = read_docstring(file) + jinja2_writer("./templates", module, data) + + +if __name__ == "__main__": + main() diff --git a/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 b/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 new file mode 100644 index 000000000..8f3633628 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 @@ -0,0 +1,60 @@ +# {{ name }} + +{{ module.doc.short_description }} + +{% if module.doc.version_added -%} +Module added in version {{ module.doc.version_added }} +{%- endif %} + +## Synopsis + +{% for desc in module.doc.description %} +{{ desc }} +{% endfor %} + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +{% for k,v in module.doc.items() %} +{% if k == 'options' %} +{% for option,values in v.items() %} +| {{ option }} | {% if values.get('type') != None %} {{ values.get('type') }} {% endif %}|{% if values.get('required') != None %} {{ values['required'] | replace('true','yes') | replace('false','no') }} {% endif %} | {% if values.get('default') != None %} {{ values['default'] | replace('None','')}} {% endif %} |{% if values.get('choices') != None %}
    {% for each in values['choices'] %}
  • {{ each }}
  • {% endfor %}
{% endif %} | {% if values.get('description') is iterable and (values.get('description') is not string and values.get('description') is not mapping) %}
    {% for each in values['description'] %}
  • {{ each }}
  • {% endfor %}
{% else %}{{ values['description'] }}{% endif %} | +{% endfor %} +{% endif %} +{% endfor %} + +{% if module.doc.module_output %} +## Module output + +??? output "Example output" + ```yaml + --8<-- + {{ module.doc.module_output }} + --8<-- + ``` +{% endif %} + +## Examples + +{% if module.examples%} +```yaml +{{ module.examples }} +``` +{% elif module.plainexamples %} +```yaml +{{ module.plainexamples }} +``` +{% endif%} + +## Author + +{{ module.doc.author }} + +{% if module.doc.schema %} +## Full schema + +Please see the [schema documentation]({{ module.doc.schema }}). +{% endif %} diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_configlet_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_configlet_v3.md index 302e14a82..01b388e2d 100644 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_configlet_v3.md +++ b/ansible_collections/arista/cvp/docs/how-to/v3/cv_configlet_v3.md @@ -10,7 +10,7 @@ To import content from text file, leverage template rendering and then load from ## Inputs -Full documentation available in [module section](../../modules/cv_configlet_v3.rst.md) and a lab is available in the following [repository](https://github.com/arista-netdevops-community/ansible-cvp-avd-toi) +Full documentation available in [module section](../../modules/cv_configlet_v3.md). ## Input variables diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_container_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_container_v3.md index b91741089..5524c84d2 100644 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_container_v3.md +++ b/ansible_collections/arista/cvp/docs/how-to/v3/cv_container_v3.md @@ -7,7 +7,7 @@ ## Inputs -Full documentation available in [module section](../../modules/cv_container_v3.rst.md) and a lab is available in the following [repository](https://github.com/arista-netdevops-community/ansible-cvp-avd-toi). +Full input definitions are available in the [module documentation](../../modules/cv_container_v3.md). ### Input variables diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_device_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_device_v3.md index 89b453106..97aef56bd 100644 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_device_v3.md +++ b/ansible_collections/arista/cvp/docs/how-to/v3/cv_device_v3.md @@ -8,7 +8,7 @@ ## Inputs -Full documentation available in [module section](../../modules/cv_container_v3.rst.md) and a lab is available in the following [repository](https://github.com/arista-netdevops-community/ansible-cvp-avd-toi) +Full input definitions are available in the [module documentation](../../modules/cv_device_v3.md). ### Input variables diff --git a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md new file mode 100644 index 000000000..9d5f7d49d --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md @@ -0,0 +1,134 @@ +# cv_change_control_v3 + +Change Control management with CloudVision + +Module added in version 3.4.0 +## Synopsis + +CloudVision Portal change control module. + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| name | str | False | | | The name of the change control. If not provided, one will be generated automatically. | +| change | dict | False | | | A dictionary containing the change control to be created/modified. | +| state | str | False | show |
  • show
  • set
  • remove
  • approve
  • unapprove
  • execute
  • schedule
  • approve_and_execute
  • schedule_and_approve
| Set if we should get, set/update, or remove the change control. | +| change_id | list | False | | | List of change IDs to get/remove. | +| schedule_time | str | False | | | RFC3339 time format, e.g., `2021-12-23T02:07:00.0`. | + +## Module output + +??? output "Example output" + ```yaml + --8<-- + docs/outputs/change_control_v3.txt + --8<-- + ``` + +## Examples + +```yaml + +--- +- name: CVP Change Control Tests + hosts: cv_server + gather_facts: no + vars: + ansible_command_timeout: 1200 + ansible_connect_timeout: 600 + change: + name: Ansible playbook test change + notes: Created via playbook + activities: + - action: "Switch Healthcheck" + name: Switch1_healthcheck + arguments: + - name: DeviceID + value: + stage: Pre-Checks + - action: "Switch Healthcheck" + name: Switch2_healthcheck + arguments: + - name: DeviceID + value: + stage: Pre-Checks + - task_id: "20" + stage: Leaf1a_upgrade + - task_id: "22" + stage: Leaf1b_upgrade + stages: + - name: Pre-Checks + mode: parallel + - name: Upgrades + modes: series + - name: Leaf1a_upgrade + parent: Upgrades + - name: Leaf1b_upgrade + parent: Upgrades + + tasks: + - name: "Gather CVP change controls {{inventory_hostname}}" + arista.cvp.cv_change_control_v3: + state: show + register: cv_facts + + - name: "Print out all change controls from {{inventory_hostname}}" + debug: + msg: "{{cv_facts}}" + + + - name: "Check CC structure" + debug: + msg: "{{change}}" + + + - name: "Create a change control on {{inventory_hostname}}" + arista.cvp.cv_change_control_v3: + state: set + change: "{{ change }}" + register: cv_change_control + + - name: "Get the created change control {{inventory_hostname}}" + arista.cvp.cv_change_control_v3: + state: show + name: change.name + register: cv_facts + + - name: "Show the created CC from {{inventory_hostname}}" + debug: + msg: "{{cv_facts}}" + + + - name: "Delete the CC from {{inventory_hostname}}" + arista.cvp.cv_change_control_v3: + state: remove + name: "{{change.name}}" + register: cv_deleted + + - name: "Show deleted CCs" + debug: + msg: "{{cv_deleted}}" + + - name: "Approve a change control on {{inventory_hostname}}" + arista.cvp.cv_change_control_v3: + state: approve + change_id: ["{{ cv_change_control.data.id }}"] + + - name: "Execute a change control on {{inventory_hostname}}" + arista.cvp.cv_change_control_v3: + state: execute + change_id: ["{{ cv_change_control.data.id }}"] + + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + +## Full schema + +Please see the [schema documentation](../schema/cv_change_control_v3.md). diff --git a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.rst.md deleted file mode 100644 index 18340b010..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.rst.md +++ /dev/null @@ -1,186 +0,0 @@ -# cv_change_control_v3 - -Change Control management with CloudVision - -Module added in version 3.4.0 - -
- -
- -## Synopsis - -CloudVision Portal Change Control Module. - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
change
dictno -
A dict containing the change control to be created/modified
-
change_id
listno -
List of change IDs to get/remove
-
name
strno -
The name of the change control, If not provided, one will be generated automatically.
-
schedule_time
strno -
RFC3339 time format, e.g., 2021-12-23T02:07:00.0
-
state
strnoshow
  • show
  • set
  • remove
  • approve
  • unapprove
  • execute
  • schedule
  • approve_and_execute
  • schedule_and_approve
-
Set if we should get, set/update, or remove the change control
-
-
- -## Examples: - - --- - - name: CVP Change Control Tests - hosts: cv_server - gather_facts: no - vars: - ansible_command_timeout: 1200 - ansible_connect_timeout: 600 - change: - name: Ansible playbook test change - notes: Created via playbook - activities: - - action: "Switch Healthcheck" - name: Switch1_healthcheck - arguments: - - name: DeviceID - value: - stage: Pre-Checks - - action: "Switch Healthcheck" - name: Switch2_healthcheck - arguments: - - name: DeviceID - value: - stage: Pre-Checks - - task_id: "20" - stage: Leaf1a_upgrade - - task_id: "22" - stage: Leaf1b_upgrade - stages: - - name: Pre-Checks - mode: parallel - - name: Upgrades - modes: series - - name: Leaf1a_upgrade - parent: Upgrades - - name: Leaf1b_upgrade - parent: Upgrades - - tasks: - - name: "Gather CVP change controls {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: show - register: cv_facts - - - name: "Print out all change controls from {{inventory_hostname}}" - debug: - msg: "{{cv_facts}}" - - - - name: "Check CC structure" - debug: - msg: "{{change}}" - - - - name: "Create a change control on {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: set - change: "{{ change }}" - register: cv_change_control - - - name: "Get the created change control {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: show - name: change.name - register: cv_facts - - - name: "Show the created CC from {{inventory_hostname}}" - debug: - msg: "{{cv_facts}}" - - - - name: "Delete the CC from {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: remove - name: "{{change.name}}" - register: cv_deleted - - - name: "Show deleted CCs" - debug: - msg: "{{cv_deleted}}" - - - name: "Approve a change control on {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: approve - change_id: ["{{ cv_change_control.data.id }}"] - - - name: "Execute a change control on {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: execute - change_id: ["{{ cv_change_control.data.id }}"] - -### Author - -- Ansible Arista Team (@aristanetworks) - -### Full Schema - -Get full schema docs [here](../../schema/cv_change_control_v3/). diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet.md new file mode 100644 index 000000000..419183928 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_configlet.md @@ -0,0 +1,67 @@ +# cv_configlet + +Create, Delete, or Update CloudVision Portal Configlets. + +Module added in version 1.0.0 +## Synopsis + +CloudVison Portal Configlet compares the list of configlets and config in +configlets against cvp-facts then adds, deletes, or updates +them as appropriate. +If a configlet is in cvp_facts but not in configlets it will be deleted. +If a configlet is in configlets but not in cvp_facts it will be created. +If a configlet is in both configlets and cvp_facts it configuration will +be compared and updated with the version in configlets +if the two are different. + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| configlets | dict | True | | | List of configlets to managed on CVP server. | +| configlets_notes | str | False | Managed by Ansible | | Add a note to the configlets. | +| cvp_facts | dict | True | | | Facts extracted from CVP servers using cv_facts module. | +| configlet_filter | list | False | ['none'] | | Filter to apply intended mode on a set of configlet. If not used, then module only uses ADD mode. configlet_filter list configlets that can be modified or deleted based on configlets entries. | +| filter_mode | str | False | loose |
  • loose
  • strict
|
  • If loose, a match is when a configlet matches a substring of a configlet defined in the filter.
  • If strict, a match is when a configlet exactly matches a configlet defined in the filter.
| +| state | str | False | present |
  • present
  • absent
|
  • If absent, configlets will be removed from CVP if they are not bound to either a container or a device.
  • If present, configlets will be created or updated.
| +| options | dict | False | | | Implements the ability to create a sub-argument_spec, where the sub options of the top level argument are also validated using the attributes discussed in this section. | + + +## Examples + +```yaml + +--- +- name: Test cv_configlet_v2 + hosts: cvp + connection: local + gather_facts: no + vars: + configlet_list: + Test_Configlet: "! This is a Very First Testing Configlet\n!" + Test_DYNAMIC_Configlet: "{{ lookup('file', 'templates/configlet_'+inventory_hostname+'.txt') }}" + tasks: + - name: 'Collecting facts from CVP {{inventory_hostname}}.' + tags: + - always + cv_facts: + register: cvp_facts + + - name: 'Create configlets on CVP {{inventory_hostname}}.' + tags: + - provision + cv_configlet: + cvp_facts: "{{cvp_facts.ansible_facts}}" + configlets: "{{configlet_list}}" + configlets_notes: "Configlet managed by Ansible" + configlet_filter: ["New", "Test","base-chk","base-firewall"] + register: cvp_configlet + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet.rst.md deleted file mode 100644 index 88fd01a40..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_configlet.rst.md +++ /dev/null @@ -1,141 +0,0 @@ -# cv_configlet - -Create, Delete, or Update CloudVision Portal Configlets. - -
- -
- -## DEPRECATED - -- In version: `4.0` -- Why : Updated modules released with increased functionality -- Alternative: Use `arista.cvp.cv_configlet_v3` instead. - -## Synopsis - -CloudVison Portal Configlet compares the list of configlets and config -in configlets against cvp-facts then adds, deletes, or updates them as -appropriate. If a configlet is in cvp_facts but not in configlets it -will be deleted. If a configlet is in configlets but not in cvp_facts it -will be created. If a configlet is in both configlets and cvp_facts it -configuration will be compared and updated with the version in -configlets if the two are different. - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
configlet_filter
listno['none'] -
Filter to apply intended mode on a set of configlet. If not used, then module only uses ADD mode. configlet_filter list configlets that can be modified or deleted based on configlets entries.
-
configlets
dictyes -
List of configlets to managed on CVP server.
-
configlets_notes
strnoManaged by Ansible -
Add a note to the configlets.
-
cvp_facts
dictyes -
Facts extracted from CVP servers using cv_facts module
-
filter_mode
strnoloose
  • loose
  • strict
-
If loose, a match is when a configlet matches a substring of a configlet defined in the filter
-
If strict, a match is when a configlet exactly matches a configlet defined in the filter
-
state
strnopresent
  • present
  • absent
-
If absent, configlets will be removed from CVP if they are not bound to either a container or a device.
-
If present, configlets will be created or updated.
-
-
- -## Examples: - - --- - - name: Test cv_configlet_v2 - hosts: cvp - connection: local - gather_facts: no - vars: - configlet_list: - Test_Configlet: "! This is a Very First Testing Configlet\n!" - Test_DYNAMIC_Configlet: "{{ lookup('file', 'templates/configlet_'+inventory_hostname+'.txt') }}" - tasks: - - name: 'Collecting facts from CVP {{inventory_hostname}}.' - tags: - - always - cv_facts: - register: cvp_facts - - - name: 'Create configlets on CVP {{inventory_hostname}}.' - tags: - - provision - cv_configlet: - cvp_facts: "{{cvp_facts.ansible_facts}}" - configlets: "{{configlet_list}}" - configlets_notes: "Configlet managed by Ansible" - configlet_filter: ["New", "Test","base-chk","base-firewall"] - register: cvp_configlet - -### Author - -- EMEA AS Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md new file mode 100644 index 000000000..4d754e885 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md @@ -0,0 +1,55 @@ +# cv_configlet_v3 + +Create, Delete, or Update CloudVision Portal Configlets. + +Module added in version 3.0.0 +## Synopsis + +CloudVison Portal Configlet compares the list of configlets and config in +configlets against cvp-facts then adds, deletes, or updates +them as appropriate. +If a configlet is in cvp_facts but not in configlets it will be deleted. +If a configlet is in configlets but not in cvp_facts it will be created. +If a configlet is in both configlets and cvp_facts it configuration will +be compared and updated with the version in configlets +if the two are different. + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| configlets | dict | True | | | List of configlets to managed on CVP server. | +| configlets_notes | str | False | Managed by Ansible | | Add a note to the configlets. | +| state | str | False | present |
  • present
  • absent
|
  • If absent, configlets will be removed from CVP if not bound to a container or a device.
  • If present, configlets will be created or updated.
| + + +## Examples + +```yaml + +--- +- name: Test cv_configlet_v3 + hosts: cvp + connection: local + gather_facts: no + vars: + configlet_list: + Test_Configlet: "! This is a Very First Testing Configlet\n!" + Test_DYNAMIC_Configlet: "{{ lookup('file', 'templates/configlet_'+inventory_hostname+'.txt') }}" + tasks: + - name: 'Create configlets on CVP {{inventory_hostname}}.' + tags: + - provision + cv_configlet: + configlets: "{{configlet_list}}" + configlets_notes: "Configlet managed by Ansible" + register: cvp_configlet + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.rst.md deleted file mode 100644 index 5d91bb41f..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.rst.md +++ /dev/null @@ -1,96 +0,0 @@ -# cv_configlet_v3 - -Create, Delete, or Update CloudVision Portal Configlets. - -Module added in version 3.0.0 - -
- -
- -## Synopsis - -CloudVison Portal Configlet compares the list of configlets and config -in configlets against cvp-facts then adds, deletes, or updates them as -appropriate. If a configlet is in cvp_facts but not in configlets it -will be deleted. If a configlet is in configlets but not in cvp_facts it -will be created. If a configlet is in both configlets and cvp_facts it -configuration will be compared and updated with the version in -configlets if the two are different. - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
configlets
dictyes -
List of configlets to managed on CVP server.
-
configlets_notes
strnoManaged by Ansible -
Add a note to the configlets.
-
state
strnopresent
  • present
  • absent
-
If absent, configlets will be removed from CVP if they are not bound
-
to either a container or a device.
-
If present, configlets will be created or updated.
-
-
- -## Examples: - - --- - - name: Test cv_configlet_v3 - hosts: cvp - connection: local - gather_facts: no - vars: - configlet_list: - Test_Configlet: "! This is a Very First Testing Configlet\n!" - Test_DYNAMIC_Configlet: "{{ lookup('file', 'templates/configlet_'+inventory_hostname+'.txt') }}" - tasks: - - name: 'Create configlets on CVP {{inventory_hostname}}.' - tags: - - provision - cv_configlet: - configlets: "{{configlet_list}}" - configlets_notes: "Configlet managed by Ansible" - register: cvp_configlet - -### Author - -- Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_container.md b/ansible_collections/arista/cvp/docs/modules/cv_container.md new file mode 100644 index 000000000..0931b5d8c --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_container.md @@ -0,0 +1,61 @@ +# cv_container + +Manage Provisioning topology. + +Module added in version 1.0.0 +## Synopsis + +CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, to create and delete containers on CVP side. +Returns number of created and/or deleted containers + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| topology | dict | True | | | Yaml dictionary to describe intended containers. | +| cvp_facts | dict | True | | | Facts from CVP collected by cv_facts module. | +| mode | str | False | merge |
  • merge
  • override
  • delete
| Allow to save topology or not. | +| configlet_filter | list | False | ['none'] | | Filter to apply intended set of configlet on containers. If not used, then module only uses ADD mode. configlet_filter list configlets that can be modified or deleted based on configlets entries. | +| options | dict | False | | | Implements the ability to create a sub-argument_spec, where the sub options of the top level argument are also validated using the attributes discussed in this section. | + + +## Examples + +```yaml + +- name: Create container topology on CVP + hosts: cvp + connection: local + gather_facts: no + vars: + verbose: False + containers: + Fabric: + parent_container: Tenant + Spines: + parent_container: Fabric + configlets: + - container_configlet + images: + - 4.22.0F + devices: + - veos01 + tasks: + - name: "Gather CVP facts {{inventory_hostname}}" + cv_facts: + register: cvp_facts + - name: "Build Container topology on {{inventory_hostname}}" + cv_container: + cvp_facts: "{{cvp_facts.ansible_facts}}" + topology: "{{containers}}" + mode: merge + register: CVP_CONTAINERS_RESULT + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + diff --git a/ansible_collections/arista/cvp/docs/modules/cv_container.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_container.rst.md deleted file mode 100644 index f405a8bb7..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_container.rst.md +++ /dev/null @@ -1,115 +0,0 @@ -# cv_container - -Manage Provisioning topology. - -
- -
- -## DEPRECATED - -- In version: `4.0` -- Why : Updated modules released with increased functionality -- Alternative: Use `arista.cvp.cv_container_v3` instead. - -## Synopsis - -CloudVision Portal Configlet configuration requires a dictionary of -containers with their parent, to create and delete containers on CVP -side. Returns number of created and/or deleted containers - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
configlet_filter
listno['none'] -
Filter to apply intended set of configlet on containers. If not used, then module only uses ADD mode. configlet_filter list configlets that can be modified or deleted based on configlets entries.
-
cvp_facts
dictyes -
Facts from CVP collected by cv_facts module
-
mode
strnomerge
  • merge
  • override
  • delete
-
Allow to save topology or not
-
topology
dictyes -
Yaml dictionary to describe intended containers
-
-
- -## Examples: - - - name: Create container topology on CVP - hosts: cvp - connection: local - gather_facts: no - vars: - verbose: False - containers: - Fabric: - parent_container: Tenant - Spines: - parent_container: Fabric - configlets: - - container_configlet - images: - - 4.22.0F - devices: - - veos01 - tasks: - - name: "Gather CVP facts {{inventory_hostname}}" - cv_facts: - register: cvp_facts - - name: "Build Container topology on {{inventory_hostname}}" - cv_container: - cvp_facts: "{{cvp_facts.ansible_facts}}" - topology: "{{containers}}" - mode: merge - register: CVP_CONTAINERS_RESULT - -### Author - -- EMEA AS Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md new file mode 100644 index 000000000..40c7b2bb2 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md @@ -0,0 +1,74 @@ +# cv_container_v3 + +Manage Provisioning topology. + +Module added in version 3.0.0 +## Synopsis + +CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, to create and delete containers on CVP side. +Module also supports to configure configlets at container level. +Returns number of created and/or deleted containers + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| topology | dict | True | | | YAML dictionary to describe intended containers. | +| state | str | False | present |
  • present
  • absent
| Set if Ansible should build or remove devices on CloudVision. | +| apply_mode | str | False | loose |
  • loose
  • strict
| Set how configlets are attached/detached to containers. If set to strict all configlets not listed in your vars will be detached. | + + +## Examples + +```yaml + +# task in loose mode (default) +- name: Create container topology on CVP + hosts: cvp + connection: local + gather_facts: no + vars: + verbose: False + containers: + Fabric: + parentContainerName: Tenant + Spines: + parentContainerName: Fabric + configlets: + - container_configlet + tasks: + - name: 'running cv_container' + arista.cvp.cv_container_v3: + topology: "{{CVP_CONTAINERS}}" + +# task in strict mode +- name: Create container topology on CVP + hosts: cvp + connection: local + gather_facts: no + vars: + verbose: False + containers: + Fabric: + parentContainerName: Tenant + Spines: + parentContainerName: Fabric + configlets: + - container_configlet + tasks: + - name: 'running cv_container' + arista.cvp.cv_container_v3: + topology: "{{CVP_CONTAINERS}}" + apply_mode: strict + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + +## Full schema + +Please see the [schema documentation](../schema/cv_container_v3.md). diff --git a/ansible_collections/arista/cvp/docs/modules/cv_container_v3.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_container_v3.rst.md deleted file mode 100644 index 35357c62e..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_container_v3.rst.md +++ /dev/null @@ -1,117 +0,0 @@ -# cv_container_v3 - -Manage Provisioning topology. - -Module added in version 3.0.0 - -
- -
- -## Synopsis - -CloudVision Portal Configlet configuration requires a dictionary of -containers with their parent, to create and delete containers on CVP -side. Module also supports to configure configlets at container level. -Returns number of created and/or deleted containers - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
apply_mode
strnoloose
  • loose
  • strict
-
Set how configlets are attached/detached to containers. If set to strict all configlets not listed in your vars will be detached.
-
state
strnopresent
  • present
  • absent
-
Set if Ansible should build or remove devices on CloudVision
-
topology
dictyes -
YAML dictionary to describe intended containers
-
-
- -## Examples: - - # task in loose mode (default) - - name: Create container topology on CVP - hosts: cvp - connection: local - gather_facts: no - vars: - verbose: False - containers: - Fabric: - parentContainerName: Tenant - Spines: - parentContainerName: Fabric - configlets: - - container_configlet - imageBundle: EOS-4.25.4M - tasks: - - name: 'running cv_container' - arista.cvp.cv_container_v3: - topology: "{{CVP_CONTAINERS}}" - - # task in strict mode - - name: Create container topology on CVP - hosts: cvp - connection: local - gather_facts: no - vars: - verbose: False - containers: - Fabric: - parentContainerName: Tenant - Spines: - parentContainerName: Fabric - configlets: - - container_configlet - tasks: - - name: 'running cv_container' - arista.cvp.cv_container_v3: - topology: "{{CVP_CONTAINERS}}" - apply_mode: strict - -### Author - -- Ansible Arista Team (@aristanetworks) - -### Full Schema - -Get full schema docs [here](../../schema/cv_container_v3/). diff --git a/ansible_collections/arista/cvp/docs/modules/cv_device.md b/ansible_collections/arista/cvp/docs/modules/cv_device.md new file mode 100644 index 000000000..bfc42c22d --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_device.md @@ -0,0 +1,86 @@ +# cv_device + +Provision, Reset, or Update CloudVision Portal Devices. + +Module added in version 1.0.0 +## Synopsis + +CloudVision Portal Device compares the list of Devices +in devices against cvp-facts then adds, resets, or updates them as appropriate. +If a device is in cvp_facts but not in devices it will be reset to factory defaults in ZTP mode +If a device is in devices but not in cvp_facts it will be provisioned +If a device is in both devices and cvp_facts its configlets and imageBundles will be compared +and updated with the version in devices if the two are different. +Warning - reset means devices will be erased and will run full ZTP process. Use this function with caution ! + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| devices | dict | True | | | Yaml dictionary to describe intended devices configuration from CVP stand point. | +| cvp_facts | dict | True | | | Facts from CVP collected by cv_facts module. | +| device_filter | list | False | ['all'] | | Filter to apply intended mode on a set of configlet. If not used, then module only uses ADD mode. device_filter list devices that can be modified or deleted based on configlets entries. | +| state | str | False | present |
  • present
  • absent
|
  • If absent, devices will be removed from CVP and moved back to undefined.
  • If present, devices will be configured or updated.
| +| configlet_mode | str | False | override |
  • override
  • merge
  • delete
|
  • If override, Add listed configlets and remove all unlisted ones.
  • If merge, Add listed configlets to device and do not touch already configured configlets.
| +| options | dict | False | | | Implements the ability to create a sub-argument_spec, where the sub options of the top level argument are also validated using the attributes discussed in this section. | + + +## Examples + +```yaml + +--- +- name: Test cv_device + hosts: cvp + connection: local + gather_facts: no + collections: + - arista.cvp + vars: + configlet_list: + cv_device_test01: "alias a{{ 999 | random }} show version" + cv_device_test02: "alias a{{ 999 | random }} show version" + # Device inventory for provision activity: bind configlet + devices_inventory: + veos01: + name: veos01 + configlets: + - cv_device_test01 + - SYS_TelemetryBuilderV2_172.23.0.2_1 + - veos01-basic-configuration + - SYS_TelemetryBuilderV2 + tasks: + # Collect CVP Facts as init process + - name: "Gather CVP facts from {{inventory_hostname}}" + cv_facts: + register: cvp_facts + tags: + - always + + - name: "Configure devices on {{inventory_hostname}}" + tags: + - provision + cv_device: + devices: "{{devices_inventory}}" + cvp_facts: '{{cvp_facts.ansible_facts}}' + device_filter: ['veos'] + register: cvp_device + + - name: "Add configlet to device on {{inventory_hostname}}" + tags: + - provision + cv_device: + devices: "{{devices_inventory}}" + cvp_facts: '{{cvp_facts.ansible_facts}}' + configlet_mode: merge + device_filter: ['veos'] + register: cvp_device + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + diff --git a/ansible_collections/arista/cvp/docs/modules/cv_device.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_device.rst.md deleted file mode 100644 index 9f87cacc8..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_device.rst.md +++ /dev/null @@ -1,154 +0,0 @@ -# cv_device - -Provision, Reset, or Update CloudVision Portal Devices. - -
- -
- -## DEPRECATED - -## DEPRECATED - -- In version: `4.0` -- Why : Updated modules released with increased functionality -- Alternative: Use `arista.cvp.cv_device_v3` instead. - -## Synopsis - -CloudVison Portal Device compares the list of Devices in devices against -cvp-facts then adds, resets, or updates them as appropriate. If a device -is in cvp_facts but not in devices it will be reset to factory defaults -in ZTP mode If a device is in devices but not in cvp_facts it will be -provisioned If a device is in both devices and cvp_facts its configlets -and imageBundles will be compared and updated with the version in -devices if the two are different. Warning - reset means devices will be -erased and will run full ZTP process. Use this function with caution ! - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
configlet_mode
strnooverride
  • override
  • merge
  • delete
-
If override, Add listed configlets and remove all unlisted ones.
-
If merge, Add listed configlets to device and do not touch already configured configlets.
-
cvp_facts
dictyes -
Facts from CVP collected by cv_facts module
-
device_filter
listno['all'] -
Filter to apply intended mode on a set of configlet. If not used, then module only uses ADD mode. device_filter list devices that can be modified or deleted based on configlets entries.
-
devices
dictyes -
Yaml dictionary to describe intended devices configuration from CVP stand point.
-
state
strnopresent
  • present
  • absent
-
If absent, devices will be removed from CVP and moved back to undefined.
-
If present, devices will be configured or updated.
-
-
- -## Examples: - - --- - - name: Test cv_device - hosts: cvp - connection: local - gather_facts: no - collections: - - arista.cvp - vars: - configlet_list: - cv_device_test01: "alias a{{ 999 | random }} show version" - cv_device_test02: "alias a{{ 999 | random }} show version" - # Device inventory for provision activity: bind configlet - devices_inventory: - veos01: - name: veos01 - configlets: - - cv_device_test01 - - SYS_TelemetryBuilderV2_172.23.0.2_1 - - veos01-basic-configuration - - SYS_TelemetryBuilderV2 - tasks: - # Collect CVP Facts as init process - - name: "Gather CVP facts from {{inventory_hostname}}" - cv_facts: - register: cvp_facts - tags: - - always - - - name: "Configure devices on {{inventory_hostname}}" - tags: - - provision - cv_device: - devices: "{{devices_inventory}}" - cvp_facts: '{{cvp_facts.ansible_facts}}' - device_filter: ['veos'] - register: cvp_device - - - name: "Add configlet to device on {{inventory_hostname}}" - tags: - - provision - cv_device: - devices: "{{devices_inventory}}" - cvp_facts: '{{cvp_facts.ansible_facts}}' - configlet_mode: merge - device_filter: ['veos'] - register: cvp_device - -### Author - -- EMEA AS Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md new file mode 100644 index 000000000..3961ba7e0 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md @@ -0,0 +1,166 @@ +# cv_device_v3 + +Manage Provisioning topology. + +Module added in version 3.0.0 +## Synopsis + +CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, to create and delete containers on CVP side. +Returns number of created and/or deleted containers + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| devices | list | True | | | List of devices with their container, configlet, and image bundle information. | +| state | str | False | present |
  • present
  • factory_reset
  • provisioning_reset
  • absent
| Set if Ansible should build, remove devices from provisioning, fully decommission or factory reset devices on CloudVision. | +| apply_mode | str | False | loose |
  • loose
  • strict
| Set how configlets are attached/detached on device. If set to strict, all configlets and image bundles not listed in your vars are detached. | +| inventory_mode | str | False | strict |
  • loose
  • strict
| Define how missing devices are handled. "loose" will ignore missing devices. "strict" will fail on any missing device. | +| search_key | str | False | hostname |
  • fqdn
  • hostname
  • serialNumber
| Key name to use to look for device in CloudVision. | + + +## Examples + +```yaml + +# task in loose apply_mode using fqdn (default) +- name: Device Management in CloudVision + hosts: cv_server + connection: local + gather_facts: false + collections: + - arista.cvp + vars: + CVP_DEVICES: + - fqdn: CV-ANSIBLE-EOS01 + parentContainerName: ANSIBLE + configlets: + - 'CV-EOS-ANSIBLE01' + imageBundle: leaf_image_bundle + tasks: + - name: "Configure devices on {{inventory_hostname}}" + arista.cvp.cv_device_v3: + devices: '{{CVP_DEVICES}}' + state: present + search_key: fqdn + +# task in loose apply_mode and loose inventory_mode using fqdn (default) +- name: Device Management in CloudVision + hosts: cv_server + connection: local + gather_facts: false + collections: + - arista.cvp + vars: + CVP_DEVICES: + - fqdn: NON-EXISTING-DEVICE + parentContainerName: ANSIBLE + configlets: + - 'CV-EOS-ANSIBLE01' + imageBundle: leaf_image_bundle + tasks: + - name: "Configure devices on {{inventory_hostname}}" + arista.cvp.cv_device_v3: + devices: '{{CVP_DEVICES}}' + state: present + search_key: fqdn + inventory_mode: loose + + +# task in loose apply_mode using serial +- name: Device Management in CloudVision + hosts: cv_server + connection: local + gather_facts: false + collections: + - arista.cvp + vars: + CVP_DEVICES: + - serialNumber: xxxxxxxxxxxx + parentContainerName: ANSIBLE + configlets: + - 'CV-EOS-ANSIBLE01' + tasks: + - name: "Configure devices on {{inventory_hostname}}" + arista.cvp.cv_device_v3: + devices: '{{CVP_DEVICES}}' + state: present + search_key: serialNumber + +# task in strict apply_mode +- name: Device Management in CloudVision + hosts: cv_server + connection: local + gather_facts: false + collections: + - arista.cvp + vars: + CVP_DEVICES: + - fqdn: CV-ANSIBLE-EOS01 + parentContainerName: ANSIBLE + configlets: + - 'CV-EOS-ANSIBLE01' + tasks: + - name: "Configure devices on {{inventory_hostname}}" + arista.cvp.cv_device_v3: + devices: '{{CVP_DEVICES}}' + state: present + apply_mode: strict + +# Decommission devices (remove from both provisioning and telemetry) +- name: Decommission device + hosts: cv_server + connection: local + gather_facts: no + vars: + CVP_DEVICES: + - fqdn: leaf1 + parentContainerName: "" + tasks: + - name: decommission device + arista.cvp.cv_device_v3: + devices: '{{CVP_DEVICES}}' + state: absent + +# Remove a device from provisioning +# Post 2021.3.0 the device will be automatically re-registered and moved to the Undefined container +- name: Remove device + hosts: CVP + connection: local + gather_facts: no + vars: + CVP_DEVICES: + - fqdn: leaf2 + parentContainerName: "" + tasks: + - name: remove device + arista.cvp.cv_device_v3: + devices: '{{CVP_DEVICES}}' + state: provisioning_reset + +# Factory reset a device (moves the device to ZTP mode) +- name: Factory reset device + hosts: CVP + connection: local + gather_facts: no + vars: + CVP_DEVICES: + - fqdn: leaf2 + parentContainerName: "" + tasks: + - name: remove device + arista.cvp.cv_device_v3: + devices: '{{CVP_DEVICES}}' + state: factory_reset + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + +## Full schema + +Please see the [schema documentation](../schema/cv_device_v3.md). diff --git a/ansible_collections/arista/cvp/docs/modules/cv_device_v3.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_device_v3.rst.md deleted file mode 100644 index b9c3d5139..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_device_v3.rst.md +++ /dev/null @@ -1,194 +0,0 @@ -# cv_device_v3 - -Manage Provisioning topology. - -Module added in version 3.0.0 - -
- -
- -## Synopsis - -CloudVision Portal Configlet configuration requires a dictionary of -containers with their parent, to create and delete containers on CVP -side. Returns number of created and/or deleted containers - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
apply_mode
strnoloose
  • loose
  • strict
-
Set how configlets are attached/detached on device. If set to strict, all configlets and image bundles not listed in your vars are detached.
-
devices
listyes -
List of devices with their container, configlet, and image bundle information
-
search_key
strnohostname
  • fqdn
  • hostname
  • serialNumber
-
Key name to use to look for device in CloudVision.
-
state
strnopresent
  • present
  • factory_reset
  • provisioning_reset
  • absent
-
Set if Ansible should build, remove devices from provisioning, fully decommission or factory reset devices on CloudVision
-
-
- -## Examples: - - # task in loose mode using fqdn (default) - - name: Device Management in CloudVision - hosts: cv_server - connection: local - gather_facts: false - collections: - - arista.cvp - vars: - CVP_DEVICES: - - fqdn: CV-ANSIBLE-EOS01 - parentContainerName: ANSIBLE - configlets: - - 'CV-EOS-ANSIBLE01' - imageBundle: leaf_image_bundle - tasks: - - name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: present - search_key: fqdn - - # task in loose mode using serial - - name: Device Management in CloudVision - hosts: cv_server - connection: local - gather_facts: false - collections: - - arista.cvp - vars: - CVP_DEVICES: - - serialNumber: xxxxxxxxxxxx - parentContainerName: ANSIBLE - configlets: - - 'CV-EOS-ANSIBLE01' - tasks: - - name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: present - search_key: serialNumber - - # task in strict mode - - name: Device Management in CloudVision - hosts: cv_server - connection: local - gather_facts: false - collections: - - arista.cvp - vars: - CVP_DEVICES: - - fqdn: CV-ANSIBLE-EOS01 - parentContainerName: ANSIBLE - configlets: - - 'CV-EOS-ANSIBLE01' - tasks: - - name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: present - apply_mode: strict - - # Decommission devices (remove from both provisioning and telemetry) - - name: Decommission device - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - fqdn: leaf1 - parentContainerName: "" - tasks: - - name: decommission device - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: absent - - # Remove a device from provisioning - # Post 2021.3.0 the device will be automatically re-registered and moved to the Undefined container - - name: Remove device - hosts: CVP - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - fqdn: leaf2 - parentContainerName: "" - tasks: - - name: remove device - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: provisioning_reset - - # Factory reset a device (moves the device to ZTP mode) - - name: Factory reset device - hosts: CVP - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - fqdn: leaf2 - parentContainerName: "" - tasks: - - name: remove device - arista.cvp.cv_device_v3: - devices: '{{CVP_DEVICES}}' - state: factory_reset - -### Author - -- Ansible Arista Team (@aristanetworks) - -### Full Schema - -Get full schema docs [here](../../schema/cv_device_v3/). diff --git a/ansible_collections/arista/cvp/docs/modules/cv_facts.md b/ansible_collections/arista/cvp/docs/modules/cv_facts.md new file mode 100644 index 000000000..3ea25c7d1 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_facts.md @@ -0,0 +1,61 @@ +# cv_facts + +Collect facts from CloudVision Portal. + +Module added in version 1.0.0 +## Synopsis + +Returns list of devices, configlets, containers and images + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| gather_subset | list | False | ['default'] |
  • default
  • config
  • tasks_pending
  • tasks_failed
  • tasks_all
| When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all, hardware, config, and interfaces. Can specify a list of values to include a larger subset. Values can also be used with an initial `!` to specify that a specific subset should not be collected. | +| facts | list | False | ['all'] |
  • all
  • devices
  • containers
  • configlets
  • tasks
| List of facts to retrieve from CVP. By default, cv_facts returns facts for devices, configlets, containers, and tasks. Using this parameter allows user to limit scope to a subset of information. | + + +## Examples + +```yaml + +--- + tasks: + - name: '#01 - Collect devices facts from {{inventory_hostname}}' + cv_facts: + facts: + devices + register: FACTS_DEVICES + + - name: '#02 - Collect devices facts (with config) from {{inventory_hostname}}' + cv_facts: + gather_subset: + config + facts: + devices + register: FACTS_DEVICES_CONFIG + + - name: '#03 - Collect confilgets facts from {{inventory_hostname}}' + cv_facts: + facts: + configlets + register: FACTS_CONFIGLETS + + - name: '#04 - Collect containers facts from {{inventory_hostname}}' + cv_facts: + facts: + containers + register: FACTS_CONTAINERS + + - name: '#10 - Collect ALL facts from {{inventory_hostname}}' + cv_facts: + register: FACTS + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + diff --git a/ansible_collections/arista/cvp/docs/modules/cv_facts.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_facts.rst.md deleted file mode 100644 index 6104c0da1..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_facts.rst.md +++ /dev/null @@ -1,102 +0,0 @@ -# cv_facts - -Collect facts from CloudVision Portal. - -
- -
- -## DEPRECATED - -- In version: `4.0` -- Why : Updated modules released with increased functionality -- Alternative: All v3 modules are now independents and cv_facts is not required anymore. - -## Synopsis - -Returns list of devices, configlets, containers and images - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
facts
listno['all']
  • all
  • devices
  • containers
  • configlets
  • tasks
-
List of facts to retrieve from CVP.
-
By default, cv_facts returns facts for devices/configlets/containers/tasks
-
Using this parameter allows user to limit scope to a subset of information.
-
gather_subset
listno['default']
  • default
  • config
  • tasks_pending
  • tasks_failed
  • tasks_all
-
When supplied, this argument will restrict the facts collected
-
to a given subset. Possible values for this argument include
-
all, hardware, config, and interfaces. Can specify a list of
-
values to include a larger subset. Values can also be used
-
with an initial ! to specify that a specific subset should
-
not be collected.
-
-
- -## Examples: - - --- - tasks: - - name: '#01 - Collect devices facts from {{inventory_hostname}}' - cv_facts: - facts: - devices - register: FACTS_DEVICES - - - name: '#02 - Collect devices facts (with config) from {{inventory_hostname}}' - cv_facts: - gather_subset: - config - facts: - devices - register: FACTS_DEVICES_CONFIG - - - name: '#03 - Collect confilgets facts from {{inventory_hostname}}' - cv_facts: - facts: - configlets - register: FACTS_CONFIGLETS - - - name: '#04 - Collect containers facts from {{inventory_hostname}}' - cv_facts: - facts: - containers - register: FACTS_CONTAINERS - - - name: '#10 - Collect ALL facts from {{inventory_hostname}}' - cv_facts: - register: FACTS - -### Author - -- EMEA AS Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md new file mode 100644 index 000000000..ae75a3512 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md @@ -0,0 +1,77 @@ +# cv_facts_v3 + +Collect facts from CloudVision + +Module added in version 3.3.0 +## Synopsis + +Returns list of devices, configlets, containers, images and tasks from CloudVision + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| facts | list | False | ['configlets', 'containers', 'devices', 'images', 'tasks'] |
  • configlets
  • containers
  • devices
  • images
  • tasks
|
  • List of facts to retrieve from CVP.
  • By default, cv_facts returns facts for devices, configlets, containers, images, and tasks.
  • Using this parameter allows user to limit scope to a subset of information.
| +| regexp_filter | str | False | .* | | Regular Expression to filter containers, configlets, devices and tasks in facts. | +| verbose | str | False | short |
  • long
  • short
| Get all data from CVP or get only cv_modules data. | + + +## Examples + +```yaml + + tasks: + - name: '#01 - Collect devices facts from {{inventory_hostname}}' + arista.cvp.cv_facts_v3: + + - name: '#02 - Collect devices facts from {{inventory_hostname}}' + arista.cvp.cv_facts_v3: + facts: + - configlets + register: FACTS_DEVICES + + - name: '#03 - Collect devices facts from {{inventory_hostname}}' + arista.cvp.cv_facts_v3: + facts: + - devices + - containers + register: FACTS_DEVICES + + - name: '#04 - Collect devices facts from {{inventory_hostname}}' + arista.cvp.cv_facts_v3: + facts: + - devices + regexp_filter: "spine1" + verbose: long + register: FACTS_DEVICES + + - name: '#05 - Collect images facts from {{inventory_hostname}}' + arista.cvp.cv_facts_v3: + facts: + - images + register: FACTS_DEVICES + + - name: '#06 - Collect task facts from {{inventory_hostname}}' + arista.cvp.cv_facts_v3: + facts: + - tasks + regexp_filter: 'Pending' # get facts filtered by task status - 'Failed', 'Pending', 'Completed', 'Cancelled' + verbose: 'long' + register: FACTS_DEVICES + + - name: '#07 - Collect task facts from {{inventory_hostname}}' + arista.cvp.cv_facts_v3: + facts: + - tasks + regexp_filter: 95 # get facts filtered by task_Id (int) + verbose: 'long' + register: FACTS_DEVICES + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + diff --git a/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.rst.md deleted file mode 100644 index ec8da17af..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.rst.md +++ /dev/null @@ -1,120 +0,0 @@ -# cv_facts_v3 - -Collect facts from CloudVision - -Module added in version 3.3.0 - -
- -
- -## Synopsis - -Returns list of devices, configlets, containers, images and tasks from -CloudVision - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
facts
listno['configlets', 'containers', 'devices', 'images', 'tasks']
  • configlets
  • containers
  • devices
  • images
  • tasks
-
List of facts to retrieve from CVP.
-
By default, cv_facts returns facts for devices/configlets/containers/images/tasks
-
Using this parameter allows user to limit scope to a subset of information.
-
regexp_filter
strno.* -
Regular Expression to filter configlets, devices, images and tasks in facts
-
verbose
strnoshort
  • long
  • short
-
get all data from CV or get only cv_modules data
-
-
- -## Examples: - - tasks: - - name: '#01 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - - - name: '#02 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - configlets - register: FACTS_DEVICES - - - name: '#03 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - devices - - containers - register: FACTS_DEVICES - - - name: '#04 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - devices - regexp_filter: "spine1" - verbose: long - register: FACTS_DEVICES - - - name: '#05 - Collect images facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - images - register: FACTS_DEVICES - - - name: '#06 - Collect task facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - tasks - regexp_filter: 'Pending' # get facts filtered by task status - 'Failed', 'Pending', 'Completed', 'Cancelled' - verbose: 'long' - register: FACTS_DEVICES - - - name: '#07 - Collect task facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - tasks - regexp_filter: 95 # get facts filtered by task_Id (int) - verbose: 'long' - register: FACTS_DEVICES - -### Author - -- Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md new file mode 100644 index 000000000..729641dd6 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md @@ -0,0 +1,75 @@ +# cv_image_v3 + +EOS Image management with CloudVision + +Module added in version 3.3.0 +## Synopsis + +CloudVision Portal Image management module. + +Due to a current limitation in CloudVision API, +authentication with token is not supported for this module only. + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| image | str | False | | | Name of the image file, including path if needed. | +| image_list | list | False | | | List of name of the image file, including path if needed. | +| bundle_name | str | False | | | Name of the bundle to manage. | +| mode | str | False | image |
  • bundle
  • image
| What to manage with the module. | +| action | str | False | get |
  • get
  • add
  • remove
| Action to perform with the module. | + + +## Examples + +```yaml + +--- +- name: CVP Image Tests + hosts: cv_server + gather_facts: no + vars: + tasks: + - name: "Gather CVP image information facts {{inventory_hostname}}" + arista.cvp.cv_image_v3: + mode: image + action: get + register: image_data + + - name: "Print out facts from {{inventory_hostname}}" + debug: + msg: "{{image_data}}" + + + - name: "Get CVP image image bundles {{inventory_hostname}}" + arista.cvp.cv_image_v3: + mode: bundle + action: get + register: image_bundle_data + + - name: "Print out images from {{inventory_hostname}}" + debug: + msg: "{{image_bundle_data}}" + + + - name: "Update an image bundle {{inventory_hostname}}" + vars: + ansible_command_timeout: 1200 + ansible_connect_timeout: 600 + arista.cvp.cv_image_v3: + mode: bundle + action: add + bundle_name: Test_bundle + image_list: + - TerminAttr-1.16.4-1.swix + - EOS-4.25.4M.swi + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + diff --git a/ansible_collections/arista/cvp/docs/modules/cv_image_v3.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_image_v3.rst.md deleted file mode 100644 index 4a73edfe8..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_image_v3.rst.md +++ /dev/null @@ -1,135 +0,0 @@ -# cv_image_v3 - -EOS Image management with CloudVision - -Module added in version 3.3.0 - -
- -
- -## Synopsis - -CloudVision Portal Image management module. - -Due to a current limitation in CloudVision API, authentication with -token is not supported for this module only. - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
action
strnoget
  • get
  • add
  • remove
-
Action to do with module
-
bundle_name
strno -
Name of the bundle to manage
-
image
strno -
Name of the image file, including path if needed
-
image_list
listno -
List of name of the image file, including path if needed
-
mode
strnoimage
  • bundle
  • image
-
What to manage with module
-
-
- -## Examples: - - --- - - name: CVP Image Tests - hosts: cv_server - gather_facts: no - vars: - tasks: - - name: "Gather CVP image information facts {{inventory_hostname}}" - arista.cvp.cv_image_v3: - mode: image - action: get - register: image_data - - - name: "Print out facts from {{inventory_hostname}}" - debug: - msg: "{{image_data}}" - - - - name: "Get CVP image image bundles {{inventory_hostname}}" - arista.cvp.cv_image_v3: - mode: bundle - action: get - register: image_bundle_data - - - name: "Print out images from {{inventory_hostname}}" - debug: - msg: "{{image_bundle_data}}" - - - - name: "Update an image bundle {{inventory_hostname}}" - vars: - ansible_command_timeout: 1200 - ansible_connect_timeout: 600 - arista.cvp.cv_image_v3: - mode: bundle - action: add - bundle_name: Test_bundle - image_list: - - TerminAttr-1.16.4-1.swix - - EOS-4.25.4M.swi - -### Author - -- Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md new file mode 100644 index 000000000..41076a123 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md @@ -0,0 +1,177 @@ +# cv_tag_v3 + +Create/Assign/Delete/Unassign tags on CVP + +Module added in version 3.4.0 +## Synopsis + +CloudVision Portal Tag module to Create/Assign/Delete/Unassign tags on CloudVision + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| tags | list | True | | | List of CVP tags. | +| mode | str | False | |
  • create
  • delete
  • assign
  • unassign
| Action to carry out on the tags. | +| auto_create | bool | False | True | | Automatically create tags before assigning. | + + +## Examples + +```yaml + +# Create and assign device and interface tags to multiple devices and interfaces +- name: cv_tag_v3 example1 + hosts: cv_server + connection: local + gather_facts: no + vars: + CVP_TAGS: + - device: leaf1 + device_tags: + - name: tag1 + value: value1 + - name: tag2 + value: value2 + - name: tag3 + value: value3 + interface_tags: + - interface: Ethernet1 + tags: + - name: tag1i + value: value1i + - name: tag2i + value: value2i + - interface: Ethernet2 + tags: + - name: tag1i + value: value1i + - name: tag2i + value: value2i + - device: spine1 + device_tags: + - name: DC + value: Dublin + - name: rack + value: rackA + - name: pod + value: podA + interface_tags: + - interface: Ethernet3 + tags: + - name: tag3i + value: value3i + - name: tag4i + value: value4i + - interface: Ethernet4 + tags: + - name: tag5i + value: value6i + - name: tag6i + value: value6i + tasks: + - name: "create tags" + arista.cvp.cv_tag_v3: + tags: "{{CVP_TAGS}}" + mode: assign + auto_create: true + +# Delete device and interface tags using device_id +- name: cv_tag_v3 example2 + hosts: cv_server + connection: local + gather_facts: no + vars: + CVP_TAGS: + - device_id: JPE123435 + device_tags: + - name: tag1 + value: value1 + interface_tags: + - interface: Ethernet1 + tags: + - name: tag1i + value: value1i + tasks: + - name: "create tags" + arista.cvp.cv_tag_v3: + tags: "{{CVP_TAGS}}" + mode: delete + +# Create device and interface tags (without assigning to the devices) using device_id +- name: cv_tag_v3 example3 + hosts: cv_server + connection: local + gather_facts: no + vars: + CVP_TAGS: + - device_id: JPE123435 + device_tags: + - name: tag1 + value: value1 + interface_tags: + - interface: Ethernet1 + tags: + - name: tag1i + value: value1i + tasks: + - name: "create tags" + arista.cvp.cv_tag_v3: + tags: "{{CVP_TAGS}}" + mode: create + +# Assign device and interface tags +- name: cv_tag_v3 example4 + hosts: cv_server + connection: local + gather_facts: no + vars: + CVP_TAGS: + - device: leaf1 + device_tags: + - name: tag1 + value: value1 + interface_tags: + - interface: Ethernet1 + tags: + - name: tag1i + value: value1i + tasks: + - name: "create tags" + arista.cvp.cv_tag_v3: + tags: "{{CVP_TAGS}}" + mode: assign + +# Unassign device and interface tags +- name: cv_tag_v3 example5 + hosts: cv_server + connection: local + gather_facts: no + vars: + CVP_TAGS: + - device: leaf1 + device_tags: + - name: tag1 + value: value1 + interface_tags: + - interface: Ethernet1 + tags: + - name: tag1i + value: value1i + tasks: + - name: "create tags" + arista.cvp.cv_tag_v3: + tags: "{{CVP_TAGS}}" + mode: assign + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + +## Full schema + +Please see the [schema documentation](../schema/cv_tag_v3.md). diff --git a/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.rst.md deleted file mode 100644 index 70b2a64aa..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.rst.md +++ /dev/null @@ -1,219 +0,0 @@ -# cv_tag_v3 - -Create/Assign/Delete/Unassign tags on CVP - -Module added in version 3.4.0 - -
- -
- -## Synopsis - -CloudVision Portal Tag module to Create/Assign/Delete/Unassign tags on -CloudVision - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
auto_create
boolnoTrue
  • yes
  • no
-
auto_create tags before assigning
-
mode
strno
  • create
  • delete
  • assign
  • unassign
-
action to carry out on the tags create - create tags delete - delete tags assign - assign existing tags to device unassign - unassign existing tags from device
-
tags
listyes -
CVP tags
-
-
- -## Examples: - - # Create and assign device and interface tags to multiple devices and interfaces - - name: cv_tag_v3 example1 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - - name: tag3 - value: value3 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - - name: tag2i - value: value2i - - interface: Ethernet2 - tags: - - name: tag1i - value: value1i - - name: tag2i - value: value2i - - device: spine1 - device_tags: - - name: DC - value: Dublin - - name: rack - value: rackA - - name: pod - value: podA - interface_tags: - - interface: Ethernet3 - tags: - - name: tag3i - value: value3i - - name: tag4i - value: value4i - - interface: Ethernet4 - tags: - - name: tag5i - value: value6i - - name: tag6i - value: value6i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: assign - auto_create: true - - # Delete device and interface tags - - name: cv_tag_v3 example2 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: delete - - # Create device and interface tags (without assigning to the devices) - - name: cv_tag_v3 example3 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: create - - # Assign device and interface tags - - name: cv_tag_v3 example4 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: assign - - # Unassign device and interface tags - - name: cv_tag_v3 example5 - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1i - value: value1i - tasks: - - name: "create tags" - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: assign - -### Author - -- Ansible Arista Team (@aristanetworks) - -### Full Schema - -Get full schema docs [here](../../schema/cv_tag_v3/). diff --git a/ansible_collections/arista/cvp/docs/modules/cv_task.md b/ansible_collections/arista/cvp/docs/modules/cv_task.md new file mode 100644 index 000000000..7ac8f9a71 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_task.md @@ -0,0 +1,52 @@ +# cv_task + +Execute or Cancel CVP Tasks. + +Module added in version 1.0.0 +## Synopsis + +CloudVision Portal Task module + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| tasks | list | True | | | CVP taskIDs to act on. | +| wait | int | False | 0 | | Time to wait for tasks to transition to 'Completed.' | +| state | str | False | executed |
  • executed
  • cancelled
| Action to carry out on the task. | +| options | dict | False | | | Implements the ability to create a sub-argument_spec, where the sub options of the top level argument are also validated using the attributes discussed in this section. | + + +## Examples + +```yaml + +--- +- name: Execute all tasks registered in cvp_configlets variable + arista.cvp.cv_task: + tasks: "{{ cvp_configlets.data.tasks }}" + +- name: Cancel a list of pending tasks + arista.cvp.cv_task: + tasks: "{{ cvp_configlets.data.tasks }}" + state: cancelled + +# Execute all pending tasks and wait for completion for 60 seconds +# In order to get a list of all pending tasks, execute cv_facts first +- name: Update cvp facts + arista.cvp.cv_facts: + +- name: Execute all pending tasks and wait for completion for 60 seconds + arista.cvp.cv_task: + port: '{{cvp_port}}' + tasks: "{{ tasks }}" + wait: 60 + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + diff --git a/ansible_collections/arista/cvp/docs/modules/cv_task.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_task.rst.md deleted file mode 100644 index 780a6f96f..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_task.rst.md +++ /dev/null @@ -1,95 +0,0 @@ -# cv_task - -Execute or Cancel CVP Tasks. - -
- -
- -## DEPRECATED - -- In version: `4.0` -- Why : Updated modules released with increased functionality -- Alternative: Use `arista.cvp.cv_task_v3` instead. - -## Synopsis - -CloudVison Portal Task module - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
state
strnoexecuted
  • executed
  • cancelled
-
action to carry out on the task executed - execute tasks cancelled - cancel tasks
-
tasks
listyes -
CVP taskIDs to act on
-
wait
intno0 -
Time to wait for tasks to transition to 'Completed'
-
-
- -## Examples: - - --- - - name: Execute all tasks registered in cvp_configlets variable - arista.cvp.cv_task: - tasks: "{{ cvp_configlets.data.tasks }}" - - - name: Cancel a list of pending tasks - arista.cvp.cv_task: - tasks: "{{ cvp_configlets.data.tasks }}" - state: cancelled - - # Execute all pending tasks and wait for completion for 60 seconds - # In order to get a list of all pending tasks, execute cv_facts first - - name: Update cvp facts - arista.cvp.cv_facts: - - - name: Execute all pending tasks and wait for completion for 60 seconds - arista.cvp.cv_task: - port: '{{cvp_port}}' - tasks: "{{ tasks }}" - wait: 60 - -### Author - -- EMEA AS Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md new file mode 100644 index 000000000..3c94a7b38 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md @@ -0,0 +1,39 @@ +# cv_task_v3 + +Execute or Cancel CVP Tasks. + +Module added in version 3.0.0 +## Synopsis + +CloudVision Portal Task module to action pending tasks on CloudVision + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| tasks | list | True | | | CVP taskIDs to act on | +| state | str | False | executed |
  • executed
  • cancelled
| Action to carry out on the task. | + + +## Examples + +```yaml + +--- +- name: Execute all tasks registered in cvp_configlets variable + arista.cvp.cv_task_v3: + tasks: "{{ cvp_configlets.taskIds }}" + +- name: Cancel a list of pending tasks + arista.cvp.cv_task_v3: + tasks: ['666', '667'] + state: cancelled + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + diff --git a/ansible_collections/arista/cvp/docs/modules/cv_task_v3.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_task_v3.rst.md deleted file mode 100644 index 0ba8f6d03..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_task_v3.rst.md +++ /dev/null @@ -1,69 +0,0 @@ -# cv_task_v3 - -Execute or Cancel CVP Tasks. - -Module added in version 3.0.0 - -
- -
- -## Synopsis - -CloudVision Portal Task module to action pending tasks on CloudVision - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
state
strnoexecuted
  • executed
  • cancelled
-
action to carry out on the task executed - execute tasks cancelled - cancel tasks
-
tasks
listyes -
CVP taskIDs to act on
-
-
- -## Examples: - - --- - - name: Execute all tasks registered in cvp_configlets variable - arista.cvp.cv_task_v3: - tasks: "{{ cvp_configlets.taskIds }}" - - - name: Cancel a list of pending tasks - arista.cvp.cv_task_v3: - tasks: ['666', '667'] - state: cancelled - -### Author - -- Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md new file mode 100644 index 000000000..d1a4e1d42 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md @@ -0,0 +1,70 @@ +# cv_validate_v3 + +CVP/Local configlet Validation + +Module added in version 3.7.0 +## Synopsis + +CloudVision Portal Validate module to Validate configlets against a device on CVP. + +## Module-specific Options + +The following options may be specified for this module: + +| parameter | type | required | default | choices | comments | +| ------------- |-------------| ---------|----------- |--------- |--------- | +| devices | list | True | | | CVP devices and configlet information. | +| validate_mode | str | True | |
  • stop_on_error
  • stop_on_warning
  • ignore
| Indicate how cv_validate_v3 should behave on finding errors and/or warnings. | + + +## Examples + +```yaml + +# offline validation +- name: offline configlet validation + hosts: cv_server + connection: local + gather_facts: no + vars: + CVP_DEVICES: + - device_name: leaf1 + search_type: hostname #[hostname | serialNumber | fqdn] + local_configlets: + valid: "interface Ethernet1\n description test_validate" + error: "ruter bgp 1111\n neighbor 1.1.1.1 remote-bs 111" + + tasks: + - name: validate module + arista.cvp.cv_validate_v3: + devices: "{{CVP_DEVICES}}" + validate_mode: stop_on_error # | stop_on_warning | valid + +# online validation +- name: Online configlet validation + hosts: cv_server + connection: local + gather_facts: no + vars: + CVP_DEVICES: + - device_name: leaf1.aristanetworks.com + search_type: fqdn #[hostname | serialNumber | fqdn] + cvp_configlets: + - valid + - invalid + + tasks: + - name: validate module + arista.cvp.cv_validate_v3: + devices: "{{CVP_DEVICES}}" + validate_mode: stop_on_error # | stop_on_warning | valid + +``` + +## Author + +Ansible Arista Team (@aristanetworks) + +## Full schema + +Please see the [schema documentation](../schema/cv_validate_v3.md). diff --git a/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.rst.md b/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.rst.md deleted file mode 100644 index 9ef3d96cc..000000000 --- a/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.rst.md +++ /dev/null @@ -1,102 +0,0 @@ -# cv_validate_v3 - -CVP/Local configlet Validation - -Module added in version 3.7.0 - -
- -
- -## Synopsis - -CloudVision Portal Validate module to Validate configlets against a -device on CVP. - -## Module-specific Options - -The following options may be specified for this module: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
parametertyperequireddefaultchoicescomments
devices
listyes -
CVP devices and configlet information.
-
validate_mode
stryes
  • stop_on_error
  • stop_on_warning
  • ignore
-
Indicate how cv_validate_v3 should behave on finding errors and/or warnings.
-
-
- -## Examples: - - # offline validation - - name: offline configlet validation - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - device_name: leaf1 - search_type: hostname #[hostname | serialNumber | fqdn] - local_configlets: - valid: "interface Ethernet1\n description test_validate" - error: "ruter bgp 1111\n neighbor 1.1.1.1 remote-bs 111" - - tasks: - - name: validate module - arista.cvp.cv_validate_v3: - devices: "{{CVP_DEVICES}}" - validate_mode: stop_on_error # | stop_on_warning | valid - - # online validation - - name: Online configlet validation - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - device_name: leaf1.aristanetworks.com - search_type: fqdn #[hostname | serialNumber | fqdn] - cvp_configlets: - - valid - - invalid - - tasks: - - name: validate module - arista.cvp.cv_validate_v3: - devices: "{{CVP_DEVICES}}" - validate_mode: stop_on_error # | stop_on_warning | valid - -### Author - -- Ansible Arista Team (@aristanetworks) - -### Full Schema - -Get full schema docs [here](../../schema/cv_validate_v3/). diff --git a/ansible_collections/arista/cvp/docs/outputs/change_control_v3.txt b/ansible_collections/arista/cvp/docs/outputs/change_control_v3.txt new file mode 100644 index 000000000..cd6c01b83 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/change_control_v3.txt @@ -0,0 +1,36 @@ + msg: + changed: true + configlets_attached: + changed: true + configlets_attached_count: 0 + configlets_attached_list: + - TEAM01_LEAFS:GLOBAL-ALIASES + diff: {} + success: true + taskIds: + - '565' + configlets_detached: + changed: false + configlets_detached_count: 0 + configlets_detached_list: [] + diff: {} + success: true + taskIds: [] + container_added: + changed: false + container_added_count: 0 + container_added_list: [] + diff: {} + success: false + taskIds: [] + container_deleted: + changed: false + container_deleted_count: 0 + container_deleted_list: [] + diff: {} + success: false + taskIds: [] + failed: false + success: true + taskIds: + - '565' diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_change_control_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_change_control_v3.py index b5f066e1d..591ba2a74 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_change_control_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_change_control_v3.py @@ -25,33 +25,34 @@ module: cv_change_control_v3 version_added: 3.4.0 author: Ansible Arista Team (@aristanetworks) +schema: ../schema/cv_change_control_v3.md +module_output: docs/outputs/change_control_v3.txt short_description: Change Control management with CloudVision description: - - CloudVision Portal Change Control Module. - - '' + - CloudVision Portal change control module. options: name: - description: The name of the change control, If not provided, one will be generated automatically. + description: The name of the change control. If not provided, one will be generated automatically. required: false type: str change: - description: A dict containing the change control to be created/modified + description: A dictionary containing the change control to be created/modified. required: false type: dict state: - description: Set if we should get, set/update, or remove the change control + description: Set if we should get, set/update, or remove the change control. required: false default: 'show' choices: ['show', 'set', 'remove', 'approve', 'unapprove', 'execute', 'schedule', 'approve_and_execute', 'schedule_and_approve'] type: str change_id: - description: List of change IDs to get/remove + description: List of change IDs to get/remove. required: false type: list elements: str schedule_time: - description: RFC3339 time format, e.g., 2021-12-23T02:07:00.0 + description: RFC3339 time format, e.g., `2021-12-23T02:07:00.0`. required: false type: str ''' diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py b/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py index 6869f8938..fecbbd532 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py @@ -52,7 +52,7 @@ default: 'Managed by Ansible' type: str cvp_facts: - description: Facts extracted from CVP servers using cv_facts module + description: Facts extracted from CVP servers using cv_facts module. required: true type: dict configlet_filter: @@ -67,9 +67,9 @@ filter_mode: description: - If loose, a match is when a configlet matches a substring of a - configlet defined in the filter + configlet defined in the filter. - If strict, a match is when a configlet exactly matches a - configlet defined in the filter + configlet defined in the filter. required: false default: 'loose' choices: ['loose', 'strict'] @@ -85,9 +85,9 @@ type: str options: description: - - Implements the ability to create a sub-argument_spec, where the sub - - options of the top level argument are also validated using - - the attributes discussed in this section. + Implements the ability to create a sub-argument_spec, where the sub + options of the top level argument are also validated using + the attributes discussed in this section. required: false type: dict ''' diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py index cd5cf02c6..0fd6e354c 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py @@ -49,8 +49,8 @@ type: str state: description: - - If absent, configlets will be removed from CVP if they are not bound - - to either a container or a device. + - If absent, configlets will be removed from CVP if not + bound to a container or a device. - If present, configlets will be created or updated. required: false default: 'present' diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_container.py b/ansible_collections/arista/cvp/plugins/modules/cv_container.py index 01bc0768e..700f4406f 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_container.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_container.py @@ -39,15 +39,15 @@ removed_from_collection: arista.cvp options: topology: - description: Yaml dictionary to describe intended containers + description: Yaml dictionary to describe intended containers. required: true type: dict cvp_facts: - description: Facts from CVP collected by cv_facts module + description: Facts from CVP collected by cv_facts module. required: true type: dict mode: - description: Allow to save topology or not + description: Allow to save topology or not. required: false default: merge choices: @@ -66,9 +66,9 @@ elements: str options: description: - - Implements the ability to create a sub-argument_spec, where the sub - - options of the top level argument are also validated using - - the attributes discussed in this section. + Implements the ability to create a sub-argument_spec, where the sub + options of the top level argument are also validated using + the attributes discussed in this section. required: false type: dict ''' diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py index 3e2834b50..79ff15311 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py @@ -31,6 +31,7 @@ module: cv_container_v3 version_added: "3.0.0" author: Ansible Arista Team (@aristanetworks) +schema: ../schema/cv_container_v3.md short_description: Manage Provisioning topology. description: - CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, @@ -39,17 +40,19 @@ - Returns number of created and/or deleted containers options: topology: - description: YAML dictionary to describe intended containers + description: YAML dictionary to describe intended containers. required: true type: dict state: - description: Set if Ansible should build or remove devices on CloudVision + description: Set if Ansible should build or remove devices on CloudVision. required: false default: 'present' choices: ['present', 'absent'] type: str apply_mode: - description: Set how configlets are attached/detached to containers. If set to strict all configlets not listed in your vars will be detached. + description: + Set how configlets are attached/detached to containers. + If set to strict all configlets not listed in your vars will be detached. required: false default: 'loose' choices: ['loose', 'strict'] diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_device.py b/ansible_collections/arista/cvp/plugins/modules/cv_device.py index 932735df3..e65b8a7c7 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_device.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_device.py @@ -45,14 +45,15 @@ required: true type: dict cvp_facts: - description: Facts from CVP collected by cv_facts module + description: Facts from CVP collected by cv_facts module. required: true type: dict device_filter: - description: Filter to apply intended mode on a set of configlet. - If not used, then module only uses ADD mode. device_filter - list devices that can be modified or deleted based - on configlets entries. + description: + Filter to apply intended mode on a set of configlet. + If not used, then module only uses ADD mode. device_filter + list devices that can be modified or deleted based + on configlets entries. required: false default: ['all'] type: list @@ -75,9 +76,9 @@ type: str options: description: - - Implements the ability to create a sub-argument_spec, where the sub - - options of the top level argument are also validated using - - the attributes discussed in this section. + Implements the ability to create a sub-argument_spec, where the sub + options of the top level argument are also validated using + the attributes discussed in this section. required: false type: dict """ diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py index c77218804..701bb1bcd 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py @@ -27,6 +27,7 @@ module: cv_device_v3 version_added: "3.0.0" author: Ansible Arista Team (@aristanetworks) +schema: ../schema/cv_device_v3.md short_description: Manage Provisioning topology. description: - CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, @@ -34,12 +35,12 @@ - Returns number of created and/or deleted containers options: devices: - description: List of devices with their container, configlet, and image bundle information + description: List of devices with their container, configlet, and image bundle information. required: true type: list elements: dict state: - description: Set if Ansible should build, remove devices from provisioning, fully decommission or factory reset devices on CloudVision + description: Set if Ansible should build, remove devices from provisioning, fully decommission or factory reset devices on CloudVision. required: false default: 'present' choices: ['present', 'factory_reset', 'provisioning_reset', 'absent'] diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_facts.py b/ansible_collections/arista/cvp/plugins/modules/cv_facts.py index 9be1653b5..2f7b17c83 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_facts.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_facts.py @@ -37,12 +37,12 @@ options: gather_subset: description: - - cv_facts. When supplied, this argument will restrict the facts collected - - to a given subset. Possible values for this argument include - - all, hardware, config, and interfaces. Can specify a list of - - values to include a larger subset. Values can also be used - - with an initial `!` to specify that a specific subset should - - not be collected. + When supplied, this argument will restrict the facts collected + to a given subset. Possible values for this argument include + all, hardware, config, and interfaces. Can specify a list of + values to include a larger subset. Values can also be used + with an initial `!` to specify that a specific subset should + not be collected. required: false default: ['default'] type: list @@ -55,9 +55,9 @@ - tasks_all facts: description: - - List of facts to retrieve from CVP. - - By default, cv_facts returns facts for devices/configlets/containers/tasks - - Using this parameter allows user to limit scope to a subset of information. + List of facts to retrieve from CVP. + By default, cv_facts returns facts for devices, configlets, containers, and tasks. + Using this parameter allows user to limit scope to a subset of information. required: false default: ['all'] type: list diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py index e99ca2e7b..470353f96 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py @@ -33,7 +33,7 @@ facts: description: - List of facts to retrieve from CVP. - - By default, cv_facts returns facts for devices/configlets/containers/images/tasks + - By default, cv_facts returns facts for devices, configlets, containers, images, and tasks. - Using this parameter allows user to limit scope to a subset of information. required: false default: ['configlets', 'containers', 'devices', 'images', 'tasks'] @@ -41,12 +41,12 @@ elements: str choices: ['configlets', 'containers', 'devices', 'images', 'tasks'] regexp_filter: - description: Regular Expression to filter containers, configlets, devices and tasks in facts + description: Regular Expression to filter containers, configlets, devices and tasks in facts. required: false default: '.*' type: str verbose: - description: get all data from CV or get only cv_modules data + description: Get all data from CVP or get only cv_modules data. required: false choices: ['long', 'short'] default: 'short' diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_image_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_image_v3.py index d334e1e60..1450c135a 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_image_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_image_v3.py @@ -33,20 +33,20 @@ - authentication with token is not supported for this module only. options: image: - description: Name of the image file, including path if needed + description: Name of the image file, including path if needed. required: false type: str image_list: - description: List of name of the image file, including path if needed + description: List of name of the image file, including path if needed. required: false type: list elements: str bundle_name: - description: Name of the bundle to manage + description: Name of the bundle to manage. required: false type: str mode: - description: What to manage with module + description: What to manage with the module. required: false type: str choices: @@ -54,7 +54,7 @@ - image default: image action: - description: Action to do with module + description: Action to perform with the module. required: false default: get type: str diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py index d2e563517..1bdec0dbb 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py @@ -25,21 +25,18 @@ module: cv_tag_v3 version_added: "3.4.0" author: Ansible Arista Team (@aristanetworks) +schema: ../schema/cv_tag_v3.md short_description: Create/Assign/Delete/Unassign tags on CVP description: - CloudVision Portal Tag module to Create/Assign/Delete/Unassign tags on CloudVision options: tags: - description: CVP tags + description: List of CVP tags. required: True type: list elements: dict mode: - description: action to carry out on the tags - create - create tags - delete - delete tags - assign - assign existing tags to device - unassign - unassign existing tags from device + description: Action to carry out on the tags. required: false type: str choices: @@ -48,7 +45,7 @@ - assign - unassign auto_create: - description: auto_create tags before assigning + description: Automatically create tags before assigning. required: false default: true type: bool diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_task.py b/ansible_collections/arista/cvp/plugins/modules/cv_task.py index 3aa171d09..b30e15a62 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_task.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_task.py @@ -35,19 +35,17 @@ removed_from_collection: arista.cvp options: tasks: - description: CVP taskIDs to act on + description: CVP taskIDs to act on. required: True type: list elements: dict wait: - description: Time to wait for tasks to transition to 'Completed' + description: Time to wait for tasks to transition to 'Completed.' required: False default: 0 type: int state: - description: action to carry out on the task - executed - execute tasks - cancelled - cancel tasks + description: Action to carry out on the task. required: false default: executed type: str @@ -56,9 +54,9 @@ - cancelled options: description: - - Implements the ability to create a sub-argument_spec, where the sub - - options of the top level argument are also validated using - - the attributes discussed in this section. + Implements the ability to create a sub-argument_spec, where the sub + options of the top level argument are also validated using + the attributes discussed in this section. required: false type: dict ''' diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_task_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_task_v3.py index 5fc17cc3d..9f86bdd25 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_task_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_task_v3.py @@ -35,9 +35,7 @@ type: list elements: str state: - description: action to carry out on the task - executed - execute tasks - cancelled - cancel tasks + description: Action to carry out on the task. required: false default: executed type: str diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py index 38830b655..04eeb7c56 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py @@ -25,6 +25,7 @@ module: cv_validate_v3 version_added: "3.7.0" author: Ansible Arista Team (@aristanetworks) +schema: ../schema/cv_validate_v3.md short_description: CVP/Local configlet Validation description: - CloudVision Portal Validate module to Validate configlets against a device on CVP. diff --git a/mkdocs.yml b/mkdocs.yml index 37e71e22e..160291eab 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -157,21 +157,21 @@ nav: - CloudVision Configlet Sync: roles/configlets_sync/README.md - Modules documentation: - Modules version 1: - - cv_facts: docs/modules/cv_facts.rst/ - - cv_configlet: docs/modules/cv_configlet.rst/ - - cv_container: docs/modules/cv_container.rst/ - - cv_device: docs/modules/cv_device.rst/ - - cv_task: docs/modules/cv_task.rst/ + - cv_facts: docs/modules/cv_facts.md + - cv_configlet: docs/modules/cv_configlet.md + - cv_container: docs/modules/cv_container.md + - cv_device: docs/modules/cv_device.md + - cv_task: docs/modules/cv_task.md - Module version 3: - - cv_configlet_v3: docs/modules/cv_configlet_v3.rst.md - - cv_container_v3: docs/modules/cv_container_v3.rst.md - - cv_device_v3: docs/modules/cv_device_v3.rst.md - - cv_task_v3: docs/modules/cv_task_v3.rst.md - - cv_facts_v3: docs/modules/cv_facts_v3.rst.md - - cv_image_v3: docs/modules/cv_image_v3.rst.md - - cv_tag_v3: docs/modules/cv_tag_v3.rst.md - - cv_change_control_v3: docs/modules/cv_change_control_v3.rst.md - - cv_validate_v3: docs/modules/cv_validate_v3.rst.md + - cv_configlet_v3: docs/modules/cv_configlet_v3.md + - cv_container_v3: docs/modules/cv_container_v3.md + - cv_device_v3: docs/modules/cv_device_v3.md + - cv_task_v3: docs/modules/cv_task_v3.md + - cv_facts_v3: docs/modules/cv_facts_v3.md + - cv_image_v3: docs/modules/cv_image_v3.md + - cv_tag_v3: docs/modules/cv_tag_v3.md + - cv_change_control_v3: docs/modules/cv_change_control_v3.md + - cv_validate_v3: docs/modules/cv_validate_v3.md - External resources: - Ansible collection user guide: https://docs.ansible.com/ansible/latest/user_guide/collections_using.html - Ansible User guide: https://docs.ansible.com/ansible/latest/user_guide/index.html From f3a32bf59a2e059344b5194ee4f9ffbcd38d37c9 Mon Sep 17 00:00:00 2001 From: juliopdx Date: Thu, 12 Oct 2023 14:46:43 -0700 Subject: [PATCH 02/15] Output updates, how-to removal, mkdocs TOC --- .../arista/cvp/docs/build-md/templates/md.j2 | 30 ++-- .../arista/cvp/docs/how-to/v1/cv_configlet.md | 88 ----------- .../arista/cvp/docs/how-to/v1/cv_container.md | 135 ---------------- .../arista/cvp/docs/how-to/v1/cv_device.md | 119 -------------- .../arista/cvp/docs/how-to/v1/cv_facts.md | 86 ---------- .../docs/how-to/v3/cv_change_control_v3.md | 114 -------------- .../cvp/docs/how-to/v3/cv_configlet_v3.md | 102 ------------ .../cvp/docs/how-to/v3/cv_container_v3.md | 108 ------------- .../arista/cvp/docs/how-to/v3/cv_device_v3.md | 130 ---------------- .../arista/cvp/docs/how-to/v3/cv_image_v3.md | 75 --------- .../arista/cvp/docs/how-to/v3/cv_tag_v3.md | 147 ------------------ .../arista/cvp/docs/how-to/v3/cv_task_v3.md | 79 ---------- .../cvp/docs/how-to/v3/cv_validate_v3.md | 96 ------------ .../cvp/docs/modules/cv_change_control_v3.md | 24 +-- .../arista/cvp/docs/modules/cv_configlet.md | 14 +- .../cvp/docs/modules/cv_configlet_v3.md | 14 +- .../arista/cvp/docs/modules/cv_container.md | 14 +- .../cvp/docs/modules/cv_container_v3.md | 18 ++- .../arista/cvp/docs/modules/cv_device.md | 15 +- .../arista/cvp/docs/modules/cv_device_v3.md | 18 ++- .../arista/cvp/docs/modules/cv_facts.md | 14 +- .../arista/cvp/docs/modules/cv_facts_v3.md | 14 +- .../arista/cvp/docs/modules/cv_image_v3.md | 6 +- .../arista/cvp/docs/modules/cv_tag_v3.md | 18 ++- .../arista/cvp/docs/modules/cv_task.md | 6 +- .../arista/cvp/docs/modules/cv_task_v3.md | 6 +- .../arista/cvp/docs/modules/cv_validate_v3.md | 20 ++- .../arista/cvp/docs/outputs/cv_configlet.txt | 10 ++ .../cvp/docs/outputs/cv_configlet_v3.txt | 40 +++++ .../arista/cvp/docs/outputs/cv_container.txt | 31 ++++ ...nge_control_v3.txt => cv_container_v3.txt} | 0 .../arista/cvp/docs/outputs/cv_device.txt | 90 +++++++++++ .../arista/cvp/docs/outputs/cv_device_v3.txt | 38 +++++ .../arista/cvp/docs/outputs/cv_facts.txt | 22 +++ .../cv_facts_v3.txt} | 83 ---------- .../arista/cvp/docs/outputs/cv_tag_v3.txt | 34 ++++ .../arista/cvp/docs/outputs/cv_task_v3.txt | 14 ++ .../cvp/docs/outputs/cv_validate_v3.txt | 15 ++ .../cvp/plugins/modules/cv_configlet.py | 1 + .../cvp/plugins/modules/cv_configlet_v3.py | 1 + .../cvp/plugins/modules/cv_container.py | 1 + .../cvp/plugins/modules/cv_container_v3.py | 1 + .../arista/cvp/plugins/modules/cv_device.py | 2 + .../cvp/plugins/modules/cv_device_v3.py | 1 + .../arista/cvp/plugins/modules/cv_facts.py | 1 + .../arista/cvp/plugins/modules/cv_facts_v3.py | 1 + .../arista/cvp/plugins/modules/cv_tag_v3.py | 1 + .../cvp/plugins/modules/cv_validate_v3.py | 3 +- mkdocs.yml | 15 -- 49 files changed, 477 insertions(+), 1438 deletions(-) delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v1/cv_configlet.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v1/cv_container.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v1/cv_device.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v1/cv_facts.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v3/cv_change_control_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v3/cv_configlet_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v3/cv_container_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v3/cv_device_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v3/cv_image_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v3/cv_tag_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v3/cv_task_v3.md delete mode 100644 ansible_collections/arista/cvp/docs/how-to/v3/cv_validate_v3.md create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_configlet.txt create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_configlet_v3.txt create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_container.txt rename ansible_collections/arista/cvp/docs/outputs/{change_control_v3.txt => cv_container_v3.txt} (100%) create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_device.txt create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_device_v3.txt create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_facts.txt rename ansible_collections/arista/cvp/docs/{how-to/v3/cv_facts_v3.md => outputs/cv_facts_v3.txt} (60%) create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_tag_v3.txt create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_task_v3.txt create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_validate_v3.txt diff --git a/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 b/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 index 8f3633628..801d33649 100644 --- a/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 +++ b/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 @@ -26,15 +26,10 @@ The following options may be specified for this module: {% endif %} {% endfor %} -{% if module.doc.module_output %} -## Module output +{% if module.doc.schema %} +## Inputs -??? output "Example output" - ```yaml - --8<-- - {{ module.doc.module_output }} - --8<-- - ``` +For a full view of the module inputs, please see the [schema documentation]({{ module.doc.schema }}). {% endif %} ## Examples @@ -49,12 +44,19 @@ The following options may be specified for this module: ``` {% endif%} -## Author - -{{ module.doc.author }} +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). -{% if module.doc.schema %} -## Full schema +{% if module.doc.module_output %} +## Module output -Please see the [schema documentation]({{ module.doc.schema }}). +??? output "Example output" + ```yaml + --8<-- + {{ module.doc.module_output }} + --8<-- + ``` {% endif %} + +## Author + +{{ module.doc.author }} diff --git a/ansible_collections/arista/cvp/docs/how-to/v1/cv_configlet.md b/ansible_collections/arista/cvp/docs/how-to/v1/cv_configlet.md deleted file mode 100644 index 38ca72983..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v1/cv_configlet.md +++ /dev/null @@ -1,88 +0,0 @@ -# Configure configlets on CloudVision - -`cv_configlet` manage configlets on CloudVision: - -- Configlets creation -- Configlets update -- Configlets deletion - -The `cv_configlet` actions are based on cv_facts results: - -- Use intend approach -- No declarative action - -To import content from text file, leverage template rendering and then load from file: use `lookup()` command - -## Inputs - -Full documentation available in [module section](../../modules/cv_configlet.rst.md) and a lab is available in the following [repository](https://github.com/arista-netdevops-community/ansible-cvp-avd-toi) - -## Input variables - -```yaml -CVP_CONFIGLETS: - TEAM01-alias: "alias a1 show version" - TEAM01-another-configlet: "alias a2 show version" -``` - -## Module inputs - -### Required Inputs - -- `cvp_facts`: Facts from cv_facts -- `configlets`: List of configlets to create -- `configlet_filter`: A filter to target only specific configlets on CV - -#### Optional inputs - -- `state`: Keyword to define if we want to create(present) or delete(absent) configlets - -```yaml ---- -- name: lab03 - cv_configlet lab - hosts: CloudVision - connection: local - gather_facts: no - vars: - CVP_CONFIGLETS: - TEAM01-alias: "alias a1 show version" - TEAM01-another-configlet: "alias a2 show version" - tasks: - - name: "Gather CVP facts {{inventory_hostname}}" - arista.cvp.cv_facts: - register: CVP_FACTS - - name: "Configure configlet on {{inventory_hostname}}" - arista.cvp.cv_configlet: - cvp_facts: "{{CVP_FACTS.ansible_facts}}" - configlets: "{{CVP_CONFIGLETS}}" - configlet_filter: ["TEAM01"] - state: present -``` - -## Module outputs - -`cv_configlet` outputs: - -- List of created configlets -- List of updated configlets -- List of deleted configlets -- List of generated tasks. - -```json -ok: [CloudVision] => { - "msg": { - "changed": true, - "data": { - "deleted": [], - "new": [ - { - "TEAM01-alias": "success" - } - ], - "tasks": [], - "updated": [] - }, - "failed": false - } -} -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v1/cv_container.md b/ansible_collections/arista/cvp/docs/how-to/v1/cv_container.md deleted file mode 100644 index abf2c06d0..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v1/cv_container.md +++ /dev/null @@ -1,135 +0,0 @@ -# Configure container on CloudVision - -cv_container manage containers on CloudVision: - -- Support creation/deletion of containers -- Support devices binding to containers -- Support configlets binding to containers - -`cv_container` bases its actions on cv_facts results - -The `cv_container` actions are based on cv_facts results: - -- Use intend approach -- No declarative action - -## Inputs - -Full documentation available in [module section](../../modules/cv_container.rst.md) and a lab is available in the following [repository](https://github.com/arista-netdevops-community/ansible-cvp-avd-toi) - -### Input variables - -- Container Name -- Parent container where to create container -- Optional list of devices to attach to container - - Devices must be already registered - - Should not be in undefined container -- Optional list of configlets to attach to container: - - Configlets must be created previously - -```yaml ---- -CVP_CONTAINERS: - TEAM01: - parent_container: Tenant - TEAM01_DC: - parent_container: TEAM01 - TEAM01_LEAFS: - parent_container: TEAM01_DC - configlets: - - GLOBAL-ALIASES - TEAM01_SPINES: - parent_container: TEAM01_DC - devices: - - sw01 - - sw02 -``` - -### Module inputs - -#### Required Inputs - -- `cvp_facts`: Facts from cv_facts -- `topology`: Container topology - -#### Optional inputs - -- `mode`: Define how to manage container available on CV and not in customer topology - - `merge` (default) - - `delete` - - `override` - -```yaml -- name: lab04 - cv_container lab - hosts: CloudVision - connection: local - gather_facts: no - tasks: - - name: "Gather CVP facts {{inventory_hostname}}" - arista.cvp.cv_facts: - register: CVP_FACTS - - name: "Configure containers on {{inventory_hostname}}" - arista.cvp.cv_container: - cvp_facts: "{{CVP_FACTS.ansible_facts}}" - topology: "{{CVP_CONTAINERS}}" -``` - -## Module output - -`cv_container` returns : - -- List of created containers -- List of deleted containers -- List of moved devices -- List of attached configlets -- List of CV tasks generated - -> Generated tasks can be consumed directly by cv_tasks. - -```json -{ -    "changed": false, -    "data": { -        "attached_configlet": { -            "configlet_attached": 4, -            "list": [ -                [ -                    { -                        "config": "alias v10 show version", -                        "containers": [ ], -                        "devices": [ ], -                        "key": "configlet_885_1325820320363417", -                        "name": "alias", -                        "type": "Static" -                    } -                ] -            ], -            "taskIds": [ -                "127" -            ] -        }, -        "changed": true, -        "creation_result": { -            "containers_created": "4" -        }, -        "deletion_result": { -            "containers_deleted": "1" -        }, -        "moved_result": { -            "devices_moved": 3, -            "list": [ -                "veos01", -                "veos02", -                "veos03" -            ], -            "taskIds": [ -                "125", -                "126", -                "127" -            ] -        }, -        "tasks": [] -    }, -    "failed": false -} -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v1/cv_device.md b/ansible_collections/arista/cvp/docs/how-to/v1/cv_device.md deleted file mode 100644 index 8b1e56149..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v1/cv_device.md +++ /dev/null @@ -1,119 +0,0 @@ -# Configure devices on CloudVision - -cv_device manage devices on CloudVision: - -- Support Configlets attachment -- Support Container move during provisioning -- Support device reset if required - -`cv_device` bases its actions on cv_facts results - -The `cv_device` actions are based on cv_facts results: - -- Use intend approach -- No declarative action - -## Inputs - -Full documentation available in [module section](../../modules/cv_container.rst.md) and a lab is available in the following [repository](https://github.com/arista-netdevops-community/ansible-cvp-avd-toi) - -CloudVison Portal Device compares the list of Devices in devices against cvp-facts then adds, resets, or updates them as appropriate. - -- If a device is in cvp_facts but not in devices it will be reset to factory defaults in ZTP mode -- If a device is in devices but not in cvp_facts it will be provisioned -- If a device is in both devices and cvp_facts its configlets and imageBundles will be compared and updated with the version in devices if the two are different. - -!!! Warning - Device reset means devices will be erased and will run full ZTP process. Use this function with caution ! - -### Input variables - -- Device name. -- Parent container where to move device. -- List of configlets to apply to the device. - -```yaml -CVP_DEVICES: - TEAM01-SPINE1: - name: TEAM01-SPINE1 - parent_container : STAGING - configlets: - - TEAM01-SPINE1 - imageBundle: [] # Not yet supported - TEAM02-SPINE1: - name: TEAM02-SPINE1 - parent_container: STAGING - configlets: - - TEAM02-SPINE1 - imageBundle: [] # Not yet supporte -``` - -### Module inputs - -#### Required Inputs - -- `cvp_facts`: Facts from cv_facts -- `devices`: List of devices -- `device_filter`: Filter to only target devices as defined in list. - -#### Optional inputs - -- `state`: Define if module should `create`(default) or `delete` devices from CV - -```yaml -- name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device: - devices: "{{CVP_DEVICES}}" - cvp_facts: '{{CVP_FACTS.ansible_facts}}' - device_filter: ['TEAM'] - state: present - register: CVP_DEVICES_RESULTS -``` - -## Module output - -`cv_device` returns : - -> Generated tasks can be consumed directly by cv_tasks. - -```json -{ -    "msg": { -        "changed": true, -        "data": { -            "new": [], -            "reset": [], -            "tasks": [ -                { -                    "currentTaskName": "Submit", -                    "description": "Ansible Configlet Update: on Device TEAM01-SPINE1", -                    "note": "", -                    "taskStatus": "ACTIVE", -                    "workOrderDetails": { -                        "ipAddress": "10.255.0.11", -                        "netElementHostName": "TEAM01-SPINE1", -                        "netElementId": "0c:1a:c1:ed:98:18", -                        "serialNumber": "6B25F852A3A3036E1ADBB4423F1E62EF", -                        "workOrderDetailsId": "", -                        "workOrderId": "" -                    }, -                    "workOrderId": "8", -                    "workOrderState": "ACTIVE", -                    "workOrderUserDefinedStatus": "Pending" -                } -            ], -            "updated": [ -                { -                    "TEAM01-SPINE1": "Configlets-[u'8']" -                }, -                { -                    "TEAM01-SPINE1": "Device TEAM01-SPINE1 \ -imageBundle cannot be updated - Exception: imageBundle_key \ -check: No imageBundle specified" -                } -            ] -        }, -        "failed": false -    } -} -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v1/cv_facts.md b/ansible_collections/arista/cvp/docs/how-to/v1/cv_facts.md deleted file mode 100644 index 977758be2..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v1/cv_facts.md +++ /dev/null @@ -1,86 +0,0 @@ -# Get facts from CloudVision - -`cv_facts` collect Facts from CloudVision: - -- CV version -- List of devices part of CV. - - Active EOS devices - - Inactive EOS devices - - 3rd part devices -- List of configlets -- List of containers -- List of tasks - -Full documentation available in [module section](../../modules/cv_facts.rst.md) and a lab is available in the following [repository](https://github.com/arista-netdevops-community/ansible-cvp-avd-toi) - -## Playbook example - -### Standard playbook - -```yaml ---- -- name: lab02 - cv_facts lab - hosts: CloudVision - connection: local - gather_facts: no - tasks: - - name: "Gather CVP facts {{inventory_hostname}}" - arista.cvp.cv_facts: - register: cv_facts -``` - -### Only collect a set of facts - -```yaml -tasks: - - name: "Gather CVP facts {{inventory_hostname}}" - arista.cvp.cv_facts: - facts: - configlets -``` - -### Collect running-configuration of devices - -```yaml -tasks: - - name: "Gather CVP facts {{inventory_hostname}}" - arista.cvp.cv_facts: - facts: - devices - gather_subset: - config -``` - -## Module output - -Output is JSON and can be saved or considered as input by other modules - -```json -{ -    "ansible_facts": { -        "cvp_info": { -            "appVersion": "Foster_Build_03",  -            "version": "2018.2.5" -        }, -        "configlets": [ -            { -                "name": "ANSIBLE_TESTING_CONTAINER", -                "isDefault": "no", -                "config": "alias a57 show version", -                "reconciled": false, -                "netElementCount": 3, -                "editable": true, -                "dateTimeInLongFormat": 1574944821353, -                "isDraft": false, -                "note": "## Managed by Ansible ##", -                "visible": true, -                "containerCount": 2, -                "user": "cvpadmin", -                "key": "configlet_3503_4572477104617871", -                "sslConfig": false, -                "devices": [ -                    "veos01", -                    "veos03" -                ], -[...] -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_change_control_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_change_control_v3.md deleted file mode 100644 index 48c7e471d..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_change_control_v3.md +++ /dev/null @@ -1,114 +0,0 @@ -# Configure a Change Control on CloudVision - -**cv_change_control_v3** manage change controls on CloudVision: - -- Create a new change control -- Modify/Update an existing change control -- Delete a change control -- Approve or Unapprove a change control -- Execute a change control -- Schedule a change control - -## Module Options - -- `state`: Can be one of the following: `set`, `show` or `remove` - - `state: set`: Set Change control - - `state: show`: List Change control - - `state: remove`: Delete Change control - - `state: approve`: Approve Change control - - `state: unapprove`: Unpprove Change control - - `state: execute`: Execute Change control - - `state: schedule`: Schedule Change control (available only on CVP 2022.1.0 and newer or CVaaS) - - `state: approve_and_execute`: Approve and Execute Change control - - `state: schedule_and_approve`: Schedule and Approve Change control (available only on CVP 2022.1.0 and newer or CVaaS) -- `change`: A dict, with the structure of the change. The change dict is structured as follows: - -```yaml -name: -notes: -stages: - - name: - mode: - parent: -activities: - - name: - stage: - task_id: - timeout: - action: - arguments: - - name: - value: -``` - -## Example - -Create a change control - -```yaml -- name: CVP Change Control - hosts: cv_server - gather_facts: no - vars: - ansible_command_timeout: 1200 - ansible_connect_timeout: 600 - change: - name: Ansible playbook test change - notes: Created via playbook - activities: - - action: "Switch Healthcheck" - name: Switch1_healthcheck - arguments: - - name: DeviceID - value: - stage: Pre-Checks - - action: "Switch Healthcheck" - name: Switch2_healthcheck - arguments: - - name: DeviceID - value: - stage: Pre-Checks - - task_id: "20" - stage: Leaf1a_upgrade - - task_id: "22" - stage: Leaf1b_upgrade - stages: - - name: Pre-Checks - mode: parallel - - name: Upgrades - modes: series - - name: Leaf1a_upgrade - parent: Upgrades - - name: Leaf1b_upgrade - parent: Upgrades - - tasks: - - name: "Gather CVP change controls {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: show - register: cv_facts - - - name: "Print out all change controls from {{inventory_hostname}}" - debug: - msg: "{{cv_facts}}" - - - name: "Check CC structure" - debug: - msg: "{{change}}" - - - name: "Create a change control on {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: set - change: "{{ change }}" - register: cv_change_control - - - name: "Approve a change control on {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: approve - change_id: ["{{ cv_change_control.data.id }}"] - - - name: "Execute a change control on {{inventory_hostname}}" - arista.cvp.cv_change_control_v3: - state: execute - change_id: ["{{ cv_change_control.data.id }}"] -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_configlet_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_configlet_v3.md deleted file mode 100644 index 01b388e2d..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_configlet_v3.md +++ /dev/null @@ -1,102 +0,0 @@ -# Configure configlets on CloudVision (v3) - -`cv_configlet_v3` manage configlets on CloudVision: - -- Configlets creation -- Configlets update -- Configlets deletion - -To import content from text file, leverage template rendering and then load from file: use `lookup()` command - -## Inputs - -Full documentation available in [module section](../../modules/cv_configlet_v3.md). - -## Input variables - -```yaml -CVP_CONFIGLETS: - TEAM01-alias: "alias a1 show version" - TEAM01-another-configlet: "alias a2 show version" -``` - -## Module inputs - -### Mandatory Inputs - -- `configlets`: List of configlets to create - -### Optional inputs - -- `state`: Keyword to define if we want to create(present) or delete(absent) configlets. Default is set to `present` - -```yaml ---- -- name: lab03 - cv_configlet lab - hosts: CloudVision - connection: local - gather_facts: no - vars: - CVP_CONFIGLETS: - TEAM01-alias: "alias a1 show version" - TEAM01-another-configlet: "alias a2 show version" - tasks: - arista.cvp.cv_configlet_v3: - configlets: "{{CVP_CONFIGLETS}}" - state: present -``` - -## Module outputs - -`cv_configlet_v3` outputs: - -- List of created configlets -- List of updated configlets -- List of deleted configlets -- List of generated tasks. - -!!! info - Generated tasks can be consumed directly by cv_tasks_v3. - -```yaml -msg: - changed: true - configlets_created: - changed: false - configlets_created_count: 0 - configlets_created_list: [] - diff: {} - success: false - taskIds: [] - configlets_deleted: - changed: false - configlets_deleted_count: 0 - configlets_deleted_list: [] - diff: {} - success: false - taskIds: [] - configlets_updated: - changed: true - configlets_updated_count: 2 - configlets_updated_list: - - 01TRAINING-alias - - 01TRAINING-01 - diff: - 01TRAINING-alias: - - 0.9565217391304348 - - - |- - --- CVP - - |- - +++ Ansible - - |- - @@ -1 +1 @@ - - -alias a101 show version - - +alias a103 show version - success: true - taskIds: - - '460' - failed: false - success: true - taskIds: - - '460' -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_container_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_container_v3.md deleted file mode 100644 index 5524c84d2..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_container_v3.md +++ /dev/null @@ -1,108 +0,0 @@ -# Configure container on CloudVision (v3) - -**cv_container_v3** manages containers on CloudVision. It supports: - -- Creation and deletion of containers -- Configlets binding to containers - -## Inputs - -Full input definitions are available in the [module documentation](../../modules/cv_container_v3.md). - -### Input variables - -- Container name -- Parent container name -- Optional list of configlets to attach to container - - The configlets must exist on the CVP server - -```yaml ---- -CVP_CONTAINERS: - TEAM01: - parentContainerName: Tenant - TEAM01_DC: - parentContainerName: TEAM01 - TEAM01_LEAFS: - parentContainerName: TEAM01_DC - configlets: - - GLOBAL-ALIASES -``` - -### Module inputs - -#### Required Inputs - -- `topology`: Container topology - -#### Optional inputs - -- `state`: Keyword to define if we want to create (present) or delete (absent) the containers. Default is set to `present`. -- `apply_mode`: Define how configlets configured to the containers are managed by ansible: - - `loose` (default): Configure new configlets to containers and **ignore** configlet already configured but not listed. - - `strict`: Configure new configlets to containers and **remove** configlet already configured but not listed. - -```yaml -- name: lab04 - cv_container lab - hosts: CloudVision - connection: local - gather_facts: no - tasks: - - name: "Configure containers on {{inventory_hostname}}" - arista.cvp.cv_container_v3: - topology: "{{CVP_CONTAINERS}}" - state: present - apply_mode: loose -``` - -## Module output - -`cv_container_v3` returns the list of: - -- attached configlets -- detached configlets -- created containers -- deleted containers -- CV tasks generated - -!!! info - Generated tasks can be consumed directly by cv_tasks_v3. - -```yaml - msg: - changed: true - configlets_attached: - changed: true - configlets_attached_count: 0 - configlets_attached_list: - - TEAM01_LEAFS:GLOBAL-ALIASES - diff: {} - success: true - taskIds: - - '565' - configlets_detached: - changed: false - configlets_detached_count: 0 - configlets_detached_list: [] - diff: {} - success: true - taskIds: [] - container_added: - changed: false - container_added_count: 0 - container_added_list: [] - diff: {} - success: false - taskIds: [] - container_deleted: - changed: false - container_deleted_count: 0 - container_deleted_list: [] - diff: {} - success: false - taskIds: [] - failed: false - success: true - taskIds: - - '565' -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_device_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_device_v3.md deleted file mode 100644 index 97aef56bd..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_device_v3.md +++ /dev/null @@ -1,130 +0,0 @@ -# Configure devices on CloudVision - -**cv_device_v3** manage devices on CloudVision: - -- Support Configlets attachment -- Support Container move during provisioning -- Support device onboarding (from undefined to any container) - -## Inputs - -Full input definitions are available in the [module documentation](../../modules/cv_device_v3.md). - -### Input variables - -- Device name. -- Parent container where to move device. -- List of configlets to apply to the device. - -```yaml -CVP_DEVICES: - - fqdn: CV-ANSIBLE-EOS01 - parentContainerName: 'ANSIBLE' - # Optional fields - configlets: - - '01TRAINING-01' - systemMacAddress: '50:8d:00:e3:78:aa' - serialNumber: 64793E1D3DE2240F547E5964354214A4 -``` - -### Module inputs - -#### Required Inputs - -- `devices`: List of devices - -#### Optional inputs - -- `state`: Define if module should `create / update`(default) or `reset` devices (`factory_reset`) from CV. By default it is set to `present`. -- `apply_mode`: Define how configlets configured to the devices are managed by ansible: - - `loose` (default): Configure new configlets to device and **ignore** configlet already configured but not listed. - - `strict`: Configure new configlets to device and **remove** configlet already configured but not listed. -- `inventory_mode`: Define how missing devices are handled. - - `loose`: Ignore missing devices. - - `strict` (default): Fail on any missing device. -- `search_key`: Define key to use to search for devices. - - `hostname`: Use Hostname to get devices. - - `fqdn`: Use Hostname + DNS to get devices. - - `serialNumber`: Use device serial number to get devices. - -!!! danger "state option" - When set to `state: factory_reset`, ansible will generate a task to reset switches to default configuration with ZTP mode enabled. - -```yaml -# Use default loose apply_mode -- name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: "{{CVP_DEVICES}}" - register: CVP_DEVICES_RESULTS - -# Use loose inventory_mode -- name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: "{{CVP_DEVICES}}" - inventory_mode: "loose" - register: CVP_DEVICES_RESULTS - -# Use strict apply_mode -- name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: "{{CVP_DEVICES}}" - apply_mode: strict - register: CVP_DEVICES_RESULTS - -# Use serial-number to search for devices. -- name: "Configure devices on {{inventory_hostname}}" - arista.cvp.cv_device_v3: - devices: "{{CVP_DEVICES}}" - state: present - apply_mode: loose - search_key: serialNumber - register: CVP_DEVICES_RESULTS -``` - -## Module output - -`cv_device` returns : - -!!! info - Generated tasks can be consumed directly by cv_tasks_v3. - -```yaml -msg: - changed: true - configlets_attached: - changed: true - configlets_attached_count: 2 - configlets_attached_list: - - CV-ANSIBLE-EOS01_configlet_attached - CV-EOS-ANSIBLE01 - diff: {} - success: true - taskIds: - - '469' - configlets_detached: - changed: true - configlets_detached_count: 1 - configlets_detached_list: - - CV-ANSIBLE-EOS01_configlet_removed - 01DEMO-alias - 01TRAINING-alias - diff: {} - success: true - taskIds: - - '469' - devices_deployed: - changed: false - devices_deployed_count: 0 - devices_deployed_list: [] - diff: {} - success: false - taskIds: [] - devices_moved: - changed: false - devices_moved_count: 0 - devices_moved_list: [] - diff: {} - success: false - taskIds: [] - failed: false - success: true - taskIds: - - '469' -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_image_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_image_v3.md deleted file mode 100644 index 564648429..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_image_v3.md +++ /dev/null @@ -1,75 +0,0 @@ -# Configure Images and Image Bundles on CloudVision - -**cv_image_v3** manage devices on CloudVision: - -- Support images package upload -- Support listing existing image bundles -- Support creating and deleting image bundles - -!!! warning - Because of a current limitation in CV API, token based authentication is not supported at the moment. - -## Modules options - -- `action`: Action to do with module. Can be one of the following: `get`, `add`, `remove` -- `mode`: What to manage with the module. Can be either `image` or `bundle` -- `bundle_name`: Name of the bundle to take care. -- `image`: File path of the image to upload -- `image_list`: List of file paths to upload to CloudVision - -## Specific settings - -As this module is in charge of uploading large files to CloudVision, it is highly recommended to change the default value for [ansible_command_timeoutandansible_connect_timeout](https://docs.ansible.com/ansible/latest/network/getting_started/network_connection_options.html) to allow ansible enough time to upload the files. - -As it is dependant of execution environment, these values must be defined by user and it can be updated only for a specific task: - -```yaml -- name: Update Image bundle - hosts: cv_server - gather_facts: no - tasks: - - name: "Update an image bundle {{inventory_hostname}}" - vars: - ansible_command_timeout: < your defined timeout value> - ansible_connect_timeout: < your defined timeout value> -... -``` - -## Examples - -### Get list of images - -```yaml ---- -- name: Get Image list from CloudVision - hosts: cv_server - gather_facts: no - vars: - tasks: - - name: "Gather CVP image information facts {{inventory_hostname}}" - arista.cvp.cv_image_v3: - mode: image - action: get - register: image_data -``` - -### Update an image bundle - -```yaml -- name: Update Image bundle - hosts: cv_server - gather_facts: no - vars: - tasks: - - name: "Update an image bundle {{inventory_hostname}}" - vars: - ansible_command_timeout: 1200 - ansible_connect_timeout: 1200 - arista.cvp.cv_image_v3: - mode: bundle - action: add - bundle_name: Test_bundle - image_list: - - '../images/swix/TerminAttr-1.16.4-1.swix' - - '~/EOS-4.25.4M.swi' -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_tag_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_tag_v3.md deleted file mode 100644 index 4fa286976..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_tag_v3.md +++ /dev/null @@ -1,147 +0,0 @@ -# Tag management on CloudVision - -**cv_tag_v3** manage tags on CloudVision: - -- Create tag on CloudVision -- Assign tag on CloudVision -- Unassign tag on CloudVision -- Delete tag on CloudVision - -## Inputs - -The documentation is available in the [module section](../../modules/cv_tag_v3.rst.md). - -### Input variables - -- list of tags -- mode (`create`, `delete`, `assign`, `unassign`) -- auto_create (`True` or `False`). Default is `True` - -### Example - -```yaml - - hosts: CloudVision - tasks: - - name: create tags - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: create - auto_create: true -``` - -### Example of creating device and interface tags - -```yaml -- name: Test cv_tag_v3 - hosts: CloudVision - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device_tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - interface_tags: - - tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - - tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - tasks: - - name: create tags - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: create - auto_create: true -``` - -### Example of assigning device and interface tags - -```yaml -- name: Test cv_tag_v3 - hosts: CloudVision - connection: local - gather_facts: no - vars: - CVP_TAGS: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - interface_tags: - - interface: Ethernet1 - tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - - interface: Ethernet2 - tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - tasks: - - name: create tags - arista.cvp.cv_tag_v3: - tags: "{{CVP_TAGS}}" - mode: assign - auto_create: true -``` - -## Actions - -| Mode | auto_create: true | auto_create: false | -|-------------------|-----------------------|------------------------| -| assign |Create tag and assign tag to
device. `device` field needed | Assign tag to device.
`device` field needed | -| unassign | Unassign tag.
`device` field needed | Unassign tag.
`device` field needed | -| create | Create tag | Create tag | -| delete | Delete tag | Delete tag | - -## Module output - -```yaml -actions_manager: - actions_manager_count: 0 - actions_manager_list: - - tag_AnsibleWorkspaceLZ7 - changed: true - diff: {} - success: true - taskIds: [] - invocation: - module_args: - auto_create: true - mode: create - tags: - - device: leaf1 - device_tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - interface_tags: - - interface: Ethernet1/1 - tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - - interface: Ethernet1/2 - tags: - - name: tag1 - value: value1 - - name: tag2 - value: value2 - success: true - taskIds: [] -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_task_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_task_v3.md deleted file mode 100644 index 8e74045c0..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_task_v3.md +++ /dev/null @@ -1,79 +0,0 @@ -# Execute / Cancel tasks on CloudVision - -**cv_task_v3** manage tasks on CloudVision: - -- Execute tasks on CloudVision -- Cancel tasks on CloudVision - -## Inputs - -The documentation is available in the [module section](../../modules/cv_task_v3.rst.md). - -### Input variables - -- list of tasks -- state (`executed` or `cancelled`). Default is `executed` - -### Example - -```yaml -- hosts: cv_server - - tasks: - - name: Execute task 743 - arista.cvp.cv_task_v3: - tasks: - - 743 - state: executed -``` - -We can execute tasks generated by other modules by: - -- registering the output in a variable -- giving the list of tasks ID to execute with the `.taskIds` field to the `cv_task_v3` module. - -### Example of moving 2 devices to a container and execute the tasks - -```yaml -- hosts: cv_server - vars: - devices: - - fqdn: DC1-SPINE1 - parentContainerName: mycontainer - configlets: - - DC1-SPINE1-configlet - - fqdn: DC1-SPINE2 - parentContainerName: mycontainer - configlets: - - DC1-SPINE2-configlet - - tasks: - - name: "Move devices to mycontainer and apply configlet" - arista.cvp.cv_device_v3: - devices: "{{devices}}" - state: present - register: CV_DEVICE_OUTPUT - - - name: Execute generated tasks - arista.cvp.cv_task_v3: - tasks: "{{ CV_DEVICE_OUTPUT.taskIds }}" -``` - -## Module output - -```yaml -msg: - actions_manager: - actions_manager_count: 2 - actions_manager_list: - - task_747 - - task_748 - changed: true - diff: {} - success: true - taskIds: [] - changed: true - failed: false - success: true - taskIds: [] -``` diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_validate_v3.md b/ansible_collections/arista/cvp/docs/how-to/v3/cv_validate_v3.md deleted file mode 100644 index f6d9094d6..000000000 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_validate_v3.md +++ /dev/null @@ -1,96 +0,0 @@ -# Validate Configlet - -**cv_validate_v3** Online and Offline configlet validation: - -- Validate configlet on CloudVision against a device (online validation) -- Validate local configlet against a device (offline validation) - -## Inputs - -The documentation is available in the [module section](../../modules/cv_validate_v3.rst.md). - -### Input variables - -- devices information -- validate_mode (`stop_on_error`, `stop_on_warning`, `ignore`) - -### Example - -```yaml - - name: validate module - arista.cvp.cv_validate_v3: - devices: "{{CVP_DEVICES}}" - validate_mode: stop_on_error -``` - -### Example of offline configlet validation - -```yaml -- name: offline configlet validation - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - device_name: leaf1 - search_type: serialNumber #[hostname | serialNumber | fqdn] - local_configlets: - valid: "interface Ethernet1\n description test_validate" - error: "ruter bgp 1111\n neighbor 1.1.1.1 remote-bs 111" - - tasks: - - name: validate module - arista.cvp.cv_validate_v3: - devices: "{{CVP_DEVICES}}" - validate_mode: stop_on_error # | stop_on_warning | valid -``` - -### Example of online configlet validation - -```yaml -- name: Online configlet validation - hosts: cv_server - connection: local - gather_facts: no - vars: - CVP_DEVICES: - - device_name: leaf1 - search_type: fqdn #[hostname | serialNumber | fqdn] - cvp_configlets: - - valid - - invalid - - tasks: - - name: validate module - arista.cvp.cv_validate_v3: - devices: "{{CVP_DEVICES}}" - validate_mode: stop_on_error # | stop_on_warning | valid -``` - -## Validation Mode - -| Mode | Description | -|-------------------|-----------------------| -| stop_on_error | Stop playbook execution when validation throws an error | -| stop_on_warning | Stop playbook execution when validation throws a warning or error | -| ignore | Ignore errors and warnings. Playbook execution does not stop | - -## Module output - -```yaml -msg: - changed: false - configlets_validated: - changed: false - configlets_validated_count: 1 - configlets_validated_list: - - validate_valid_on_serialNumber_validated - diff: {} - errors: [] - success: true - taskIds: [] - warnings: [] - failed: false - success: true - taskIds: [] -``` diff --git a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md index 9d5f7d49d..7d0b449de 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md @@ -19,14 +19,9 @@ The following options may be specified for this module: | change_id | list | False | | | List of change IDs to get/remove. | | schedule_time | str | False | | | RFC3339 time format, e.g., `2021-12-23T02:07:00.0`. | -## Module output +## Inputs -??? output "Example output" - ```yaml - --8<-- - docs/outputs/change_control_v3.txt - --8<-- - ``` +For a full view of the module inputs, please see the [schema documentation](../schema/cv_change_control_v3.md). ## Examples @@ -125,10 +120,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). -Ansible Arista Team (@aristanetworks) +## Module output -## Full schema +??? output "Example output" + ```yaml + --8<-- + docs/outputs/change_control_v3.txt + --8<-- + ``` + +## Author -Please see the [schema documentation](../schema/cv_change_control_v3.md). +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet.md index 419183928..a49b471a9 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_configlet.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_configlet.md @@ -61,7 +61,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). + +## Module output -Ansible Arista Team (@aristanetworks) +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_configlet.txt + --8<-- + ``` + +## Author +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md index 4d754e885..73fea8c2a 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md @@ -49,7 +49,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). + +## Module output -Ansible Arista Team (@aristanetworks) +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_configlet_v3.txt + --8<-- + ``` + +## Author +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_container.md b/ansible_collections/arista/cvp/docs/modules/cv_container.md index 0931b5d8c..cb14371e7 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_container.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_container.md @@ -55,7 +55,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). + +## Module output -Ansible Arista Team (@aristanetworks) +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_container.txt + --8<-- + ``` + +## Author +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md index 40c7b2bb2..b02cdd120 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md @@ -19,6 +19,9 @@ The following options may be specified for this module: | state | str | False | present |
  • present
  • absent
| Set if Ansible should build or remove devices on CloudVision. | | apply_mode | str | False | loose |
  • loose
  • strict
| Set how configlets are attached/detached to containers. If set to strict all configlets not listed in your vars will be detached. | +## Inputs + +For a full view of the module inputs, please see the [schema documentation](../schema/cv_container_v3.md). ## Examples @@ -65,10 +68,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). -Ansible Arista Team (@aristanetworks) +## Module output -## Full schema +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_container_v3.txt + --8<-- + ``` + +## Author -Please see the [schema documentation](../schema/cv_container_v3.md). +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_device.md b/ansible_collections/arista/cvp/docs/modules/cv_device.md index bfc42c22d..7e77315d4 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_device.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_device.md @@ -46,6 +46,7 @@ The following options may be specified for this module: devices_inventory: veos01: name: veos01 + parentContainername: veos01 configlets: - cv_device_test01 - SYS_TelemetryBuilderV2_172.23.0.2_1 @@ -80,7 +81,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). + +## Module output -Ansible Arista Team (@aristanetworks) +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_device.txt + --8<-- + ``` + +## Author +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md index 3961ba7e0..28108f700 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md @@ -20,6 +20,9 @@ The following options may be specified for this module: | inventory_mode | str | False | strict |
  • loose
  • strict
| Define how missing devices are handled. "loose" will ignore missing devices. "strict" will fail on any missing device. | | search_key | str | False | hostname |
  • fqdn
  • hostname
  • serialNumber
| Key name to use to look for device in CloudVision. | +## Inputs + +For a full view of the module inputs, please see the [schema documentation](../schema/cv_device_v3.md). ## Examples @@ -157,10 +160,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). -Ansible Arista Team (@aristanetworks) +## Module output -## Full schema +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_device_v3.txt + --8<-- + ``` + +## Author -Please see the [schema documentation](../schema/cv_device_v3.md). +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_facts.md b/ansible_collections/arista/cvp/docs/modules/cv_facts.md index 3ea25c7d1..5fd64bf8b 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_facts.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_facts.md @@ -55,7 +55,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). + +## Module output -Ansible Arista Team (@aristanetworks) +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_facts.txt + --8<-- + ``` + +## Author +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md index ae75a3512..e3291a10f 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md @@ -71,7 +71,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). + +## Module output -Ansible Arista Team (@aristanetworks) +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_facts_v3.txt + --8<-- + ``` + +## Author +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md index 729641dd6..2c05ad988 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md @@ -69,7 +69,9 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). + -Ansible Arista Team (@aristanetworks) +## Author +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md index 41076a123..ec41c9674 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md @@ -17,6 +17,9 @@ The following options may be specified for this module: | mode | str | False | |
  • create
  • delete
  • assign
  • unassign
| Action to carry out on the tags. | | auto_create | bool | False | True | | Automatically create tags before assigning. | +## Inputs + +For a full view of the module inputs, please see the [schema documentation](../schema/cv_tag_v3.md). ## Examples @@ -168,10 +171,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). -Ansible Arista Team (@aristanetworks) +## Module output -## Full schema +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_tag_v3.txt + --8<-- + ``` + +## Author -Please see the [schema documentation](../schema/cv_tag_v3.md). +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_task.md b/ansible_collections/arista/cvp/docs/modules/cv_task.md index 7ac8f9a71..6c06bb0fd 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_task.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_task.md @@ -46,7 +46,9 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). + -Ansible Arista Team (@aristanetworks) +## Author +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md index 3c94a7b38..e75eacc5a 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md @@ -33,7 +33,9 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). + -Ansible Arista Team (@aristanetworks) +## Author +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md index d1a4e1d42..e99cbe5e9 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md @@ -14,8 +14,11 @@ The following options may be specified for this module: | parameter | type | required | default | choices | comments | | ------------- |-------------| ---------|----------- |--------- |--------- | | devices | list | True | | | CVP devices and configlet information. | -| validate_mode | str | True | |
  • stop_on_error
  • stop_on_warning
  • ignore
| Indicate how cv_validate_v3 should behave on finding errors and/or warnings. | +| validate_mode | str | True | |
  • stop_on_error
  • stop_on_warning
  • ignore
| Indicate how cv_validate_v3 should behave on finding errors or warnings. | +## Inputs + +For a full view of the module inputs, please see the [schema documentation](../schema/cv_validate_v3.md). ## Examples @@ -61,10 +64,17 @@ The following options may be specified for this module: ``` -## Author +For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). -Ansible Arista Team (@aristanetworks) +## Module output -## Full schema +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_validate_v3.txt + --8<-- + ``` + +## Author -Please see the [schema documentation](../schema/cv_validate_v3.md). +Ansible Arista Team (@aristanetworks) \ No newline at end of file diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_configlet.txt b/ansible_collections/arista/cvp/docs/outputs/cv_configlet.txt new file mode 100644 index 000000000..8704075f1 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_configlet.txt @@ -0,0 +1,10 @@ + cvp_configlet: + changed: true + data: + deleted: [] + new: + - Test_Configlet: success + tasks: [] + updated: [] + diff: '' + failed: false diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_configlet_v3.txt b/ansible_collections/arista/cvp/docs/outputs/cv_configlet_v3.txt new file mode 100644 index 000000000..4a7dd5878 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_configlet_v3.txt @@ -0,0 +1,40 @@ +msg: + changed: true + configlets_created: + changed: false + configlets_created_count: 0 + configlets_created_list: [] + diff: {} + success: false + taskIds: [] + configlets_deleted: + changed: false + configlets_deleted_count: 0 + configlets_deleted_list: [] + diff: {} + success: false + taskIds: [] + configlets_updated: + changed: true + configlets_updated_count: 2 + configlets_updated_list: + - 01TRAINING-alias + - 01TRAINING-01 + diff: + 01TRAINING-alias: + - 0.9565217391304348 + - - |- + --- CVP + - |- + +++ Ansible + - |- + @@ -1 +1 @@ + - -alias a101 show version + - +alias a103 show version + success: true + taskIds: + - '460' + failed: false + success: true + taskIds: + - '460' diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_container.txt b/ansible_collections/arista/cvp/docs/outputs/cv_container.txt new file mode 100644 index 000000000..aef239852 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_container.txt @@ -0,0 +1,31 @@ + containers: + changed: false + cv_container: + attached_configlet: + configlet_attached: 0 + list: [] + taskIds: [] + changed: true + creation_result: + containers_created: '2' + moved_result: + devices_moved: 0 + list: [] + taskIds: [] + taskIds: [] + tasks: [] + data: + attached_configlet: + configlet_attached: 0 + list: [] + taskIds: [] + changed: true + creation_result: + containers_created: '2' + moved_result: + devices_moved: 0 + list: [] + taskIds: [] + taskIds: [] + tasks: [] + failed: false diff --git a/ansible_collections/arista/cvp/docs/outputs/change_control_v3.txt b/ansible_collections/arista/cvp/docs/outputs/cv_container_v3.txt similarity index 100% rename from ansible_collections/arista/cvp/docs/outputs/change_control_v3.txt rename to ansible_collections/arista/cvp/docs/outputs/cv_container_v3.txt diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_device.txt b/ansible_collections/arista/cvp/docs/outputs/cv_device.txt new file mode 100644 index 000000000..f8b7bebac --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_device.txt @@ -0,0 +1,90 @@ + cvp_device: + changed: true + data: + added_tasksIds: [] + moved: [] + moved_devices: 0 + moved_tasksIds: [] + provisionned: [] + provisionned_devices: 0 + tasks: + - ccId: '' + ccIdV2: '' + completedOnInLongFormat: 1697146035906 + createdBy: arista + createdOnInLongFormat: 1697146030753 + currentTaskName: Submit + currentTaskType: User Task + data: + APP_SESSION_ID: '' + ERROR_IN_CAPTURING_DESIGN_CONFIG: '' + ERROR_IN_CAPTURING_RUNNING_CONFIG: '' + INCORRECT_CONFIG_IN_CAPTURING_DESIGN_CONFIG: '' + INCORRECT_CONFIG_IN_CAPTURING_DESIGN_CONFIG_OUTPUT_INDEX: '' + IS_ADD_OR_MOVE_FLOW: false + IS_AUTO_GENERATED_IN_CVP: false + IS_CONFIG_PUSH_NEEDED: 'yes' + NETELEMENT_ID: 00:1c:73:c0:c6:16 + VIEW: CONFIG + WORKFLOW_ACTION: Configlet Push + ZERO_TOUCH_REPLACEMENT: '' + ccExecutingNode: '' + ccId: '' + commandUsedInMgmtIpVal: '' + config: [] + configExistInCVP: false + configSnapshots: [] + configletList: [] + currentparentContainerId: container_4d9e2b7f-c63d-46ee-8fe0-9d7fad83baee + designedConfig: '' + designedConfigOutputIndex: '' + extensionsRequireReboot: [] + ignoreConfigletList: [] + image: '' + imageBundleId: '' + imageId: [] + imageIdList: [] + imageToBePushedToDevice: '' + isDCAEnabled: false + isRollbackFromSnapshotFlow: false + isRollbackTask: false + newparentContainerId: container_4d9e2b7f-c63d-46ee-8fe0-9d7fad83baee + noOfRe-Tries: 0 + preRollbackImage: '' + presentImageInDevice: '' + runningConfig: '' + sessionUsedInMgmtIpVal: '' + targetIpAddress: '' + user: '' + description: 'Ansible: Configlet Assign: to Device s1-host1.atd.lab' + dualSupervisor: false + executedBy: '' + executedOnInLongFormat: 0 + name: '' + netElementId: 00:1c:73:c0:c6:16 + newParentContainerId: container_4d9e2b7f-c63d-46ee-8fe0-9d7fad83baee + newParentContainerName: S1-Hosts + note: '' + stageId: '' + taskStatus: ACTIVE + taskStatusBeforeCancel: '' + templateId: ztp + workFlowDetailsId: '' + workOrderDetails: + ipAddress: 192.168.0.244 + netElementHostName: s1-host1.atd.lab + netElementId: 00:1c:73:c0:c6:16 + serialNumber: s1-host1 + workOrderDetailsId: '' + workOrderId: '' + workOrderId: '73' + workOrderState: ACTIVE + workOrderUserDefinedStatus: Pending + tasksIds: + - '73' + updated: + - s1-host1: Configlets-['73'] + updated_devices: 1 + updated_tasksIds: + - '73' + failed: false diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_device_v3.txt b/ansible_collections/arista/cvp/docs/outputs/cv_device_v3.txt new file mode 100644 index 000000000..6fbeaedb7 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_device_v3.txt @@ -0,0 +1,38 @@ +msg: + changed: true + configlets_attached: + changed: true + configlets_attached_count: 2 + configlets_attached_list: + - CV-ANSIBLE-EOS01_configlet_attached - CV-EOS-ANSIBLE01 + diff: {} + success: true + taskIds: + - '469' + configlets_detached: + changed: true + configlets_detached_count: 1 + configlets_detached_list: + - CV-ANSIBLE-EOS01_configlet_removed - 01DEMO-alias - 01TRAINING-alias + diff: {} + success: true + taskIds: + - '469' + devices_deployed: + changed: false + devices_deployed_count: 0 + devices_deployed_list: [] + diff: {} + success: false + taskIds: [] + devices_moved: + changed: false + devices_moved_count: 0 + devices_moved_list: [] + diff: {} + success: false + taskIds: [] + failed: false + success: true + taskIds: + - '469' diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_facts.txt b/ansible_collections/arista/cvp/docs/outputs/cv_facts.txt new file mode 100644 index 000000000..b93db582b --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_facts.txt @@ -0,0 +1,22 @@ +ansible_facts: + cvp_info: + editable: 2023.1.1 + configlets: + - name: ANSIBLE_TESTING_CONTAINER + isDefault: 'no' + config: alias a57 show version + reconciled: false + netElementCount: 3 + editable: true + dateTimeInLongFormat: 1574944821353 + isDraft: false + note: '## Managed by Ansible ##' + visible: true + containerCount: 2 + user: cvpadmin + key: configlet_3503_4572477104617871 + sslConfig: false + devices: + - veos01 + - veos03 +... diff --git a/ansible_collections/arista/cvp/docs/how-to/v3/cv_facts_v3.md b/ansible_collections/arista/cvp/docs/outputs/cv_facts_v3.txt similarity index 60% rename from ansible_collections/arista/cvp/docs/how-to/v3/cv_facts_v3.md rename to ansible_collections/arista/cvp/docs/outputs/cv_facts_v3.txt index 63ca7073f..a4e2e1dbe 100644 --- a/ansible_collections/arista/cvp/docs/how-to/v3/cv_facts_v3.md +++ b/ansible_collections/arista/cvp/docs/outputs/cv_facts_v3.txt @@ -1,82 +1,3 @@ -# Get provisioning information from CloudVision - -**cv_facts_v3** get provisioning information from CloudVision: - -- Support static configlets -- Support List of containers -- Support list of devices -- Support list of images -- Support list of tasks - -## Inputs - -This module does not support input data except module options. - -### Optional module inputs - -- `facts`: List of facts to get from CloudVision. It can be any of the following entries: [`devices`, `configlets`, `container`, `images`, `tasks`] -- `regexp_filter`: [Regualr expression](https://docs.python.org/3/howto/regex.html) to filter `configlets`, `devices`, `images`, and `tasks` to only collect facts for interesting entries. -- `verbose`: Facts Verbosity. - - `long` - get all data from CV. - - `short` - get only cv_modules data. - - Default is `short` - -```yaml -tasks: -- name: '#01 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - -- name: '#02 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - configlets - register: FACTS_DEVICES - -- name: '#03 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - devices - - containers - register: FACTS_DEVICES - -- name: '#04 - Collect devices facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - devices - - containers - regexp_filter: '.*LEAF|BORDER.*' - verbose: long - register: FACTS_DEVICES - -- name: '#05 - Collect images facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - images - register: FACTS_DEVICES - -- name: '#06 - Collect task facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - tasks - regexp_filter: 'Pending' # get facts filtered by task status - 'Failed', 'Pending', 'Completed', 'Cancelled' - verbose: 'long' - register: FACTS_DEVICES - -- name: '#07 - Collect task facts from {{inventory_hostname}}' - arista.cvp.cv_facts_v3: - facts: - - tasks - regexp_filter: 95 # get facts filtered by task_Id (int) - verbose: 'long' - register: FACTS_DEVICES -``` - -## Module output - -`cv_facts_v3` returns: - -```yaml -ok: [CloudVision] => msg: changed: false data: @@ -168,7 +89,3 @@ ok: [CloudVision] => workOrderUserDefinedStatus: "Cancelled" total_tasks": 1 failed: false -``` - -!!! info - All sections can be natively reused in their respective module to reconfigure CloudVision. It can be used as a custom backup task or to synchronize multiple CloudVision instances. diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_tag_v3.txt b/ansible_collections/arista/cvp/docs/outputs/cv_tag_v3.txt new file mode 100644 index 000000000..966d53334 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_tag_v3.txt @@ -0,0 +1,34 @@ +actions_manager: + actions_manager_count: 0 + actions_manager_list: + - tag_AnsibleWorkspaceLZ7 + changed: true + diff: {} + success: true + taskIds: [] + invocation: + module_args: + auto_create: true + mode: create + tags: + - device: leaf1 + device_tags: + - name: tag1 + value: value1 + - name: tag2 + value: value2 + interface_tags: + - interface: Ethernet1/1 + tags: + - name: tag1 + value: value1 + - name: tag2 + value: value2 + - interface: Ethernet1/2 + tags: + - name: tag1 + value: value1 + - name: tag2 + value: value2 + success: true + taskIds: [] diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_task_v3.txt b/ansible_collections/arista/cvp/docs/outputs/cv_task_v3.txt new file mode 100644 index 000000000..3842753e8 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_task_v3.txt @@ -0,0 +1,14 @@ +msg: + actions_manager: + actions_manager_count: 2 + actions_manager_list: + - task_747 + - task_748 + changed: true + diff: {} + success: true + taskIds: [] + changed: true + failed: false + success: true + taskIds: [] diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_validate_v3.txt b/ansible_collections/arista/cvp/docs/outputs/cv_validate_v3.txt new file mode 100644 index 000000000..2657259e7 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_validate_v3.txt @@ -0,0 +1,15 @@ +msg: + changed: false + configlets_validated: + changed: false + configlets_validated_count: 1 + configlets_validated_list: + - validate_valid_on_serialNumber_validated + diff: {} + errors: [] + success: true + taskIds: [] + warnings: [] + failed: false + success: true + taskIds: [] diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py b/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py index fecbbd532..49a9c5765 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py @@ -26,6 +26,7 @@ module: cv_configlet version_added: "1.0.0" author: Ansible Arista Team (@aristanetworks) +module_output: docs/outputs/cv_configlet.txt short_description: Create, Delete, or Update CloudVision Portal Configlets. description: - CloudVison Portal Configlet compares the list of configlets and config in diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py index 0fd6e354c..1ff3abd30 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py @@ -27,6 +27,7 @@ module: cv_configlet_v3 version_added: "3.0.0" author: Ansible Arista Team (@aristanetworks) +module_output: docs/outputs/cv_configlet_v3.txt short_description: Create, Delete, or Update CloudVision Portal Configlets. description: - CloudVison Portal Configlet compares the list of configlets and config in diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_container.py b/ansible_collections/arista/cvp/plugins/modules/cv_container.py index 700f4406f..b69f1ac73 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_container.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_container.py @@ -27,6 +27,7 @@ module: cv_container version_added: "1.0.0" author: Ansible Arista Team (@aristanetworks) +module_output: docs/outputs/cv_container.txt short_description: Manage Provisioning topology. description: - CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py index 79ff15311..502df5bb3 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py @@ -32,6 +32,7 @@ version_added: "3.0.0" author: Ansible Arista Team (@aristanetworks) schema: ../schema/cv_container_v3.md +module_output: docs/outputs/cv_container_v3.txt short_description: Manage Provisioning topology. description: - CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_device.py b/ansible_collections/arista/cvp/plugins/modules/cv_device.py index e65b8a7c7..b4cc21617 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_device.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_device.py @@ -24,6 +24,7 @@ module: cv_device version_added: "1.0.0" author: Ansible Arista Team (@aristanetworks) +module_output: docs/outputs/cv_device.txt short_description: Provision, Reset, or Update CloudVision Portal Devices. description: - CloudVision Portal Device compares the list of Devices @@ -99,6 +100,7 @@ devices_inventory: veos01: name: veos01 + parentContainername: veos01 configlets: - cv_device_test01 - SYS_TelemetryBuilderV2_172.23.0.2_1 diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py index 701bb1bcd..63e193942 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py @@ -28,6 +28,7 @@ version_added: "3.0.0" author: Ansible Arista Team (@aristanetworks) schema: ../schema/cv_device_v3.md +module_output: docs/outputs/cv_device_v3.txt short_description: Manage Provisioning topology. description: - CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_facts.py b/ansible_collections/arista/cvp/plugins/modules/cv_facts.py index 2f7b17c83..327e733d4 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_facts.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_facts.py @@ -26,6 +26,7 @@ module: cv_facts version_added: "1.0.0" author: Ansible Arista Team (@aristanetworks) +module_output: docs/outputs/cv_facts.txt short_description: Collect facts from CloudVision Portal. deprecated: removed_in: '4.0.0' diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py index 470353f96..fa6c1e8ee 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py @@ -26,6 +26,7 @@ module: cv_facts_v3 version_added: "3.3.0" author: Ansible Arista Team (@aristanetworks) +module_output: docs/outputs/cv_facts_v3.txt short_description: Collect facts from CloudVision description: - Returns list of devices, configlets, containers, images and tasks from CloudVision diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py index 1bdec0dbb..9b97ca8ca 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py @@ -26,6 +26,7 @@ version_added: "3.4.0" author: Ansible Arista Team (@aristanetworks) schema: ../schema/cv_tag_v3.md +module_output: docs/outputs/cv_tag_v3.txt short_description: Create/Assign/Delete/Unassign tags on CVP description: - CloudVision Portal Tag module to Create/Assign/Delete/Unassign tags on CloudVision diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py index 04eeb7c56..8dc664d41 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py @@ -26,6 +26,7 @@ version_added: "3.7.0" author: Ansible Arista Team (@aristanetworks) schema: ../schema/cv_validate_v3.md +module_output: docs/outputs/cv_validate_v3.txt short_description: CVP/Local configlet Validation description: - CloudVision Portal Validate module to Validate configlets against a device on CVP. @@ -36,7 +37,7 @@ type: list elements: dict validate_mode: - description: Indicate how cv_validate_v3 should behave on finding errors and/or warnings. + description: Indicate how cv_validate_v3 should behave on finding errors or warnings. required: true type: str choices: diff --git a/mkdocs.yml b/mkdocs.yml index 160291eab..37967f20b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -121,21 +121,6 @@ nav: - Requirements: docs/installation/requirements.md - How-To: - CV Authentication: docs/how-to/cvp-authentication.md - - CV Modules v1: - - Get Facts: docs/how-to/v1/cv_facts.md - - Manage configlets: docs/how-to/v1/cv_configlet.md - - Manage containers: docs/how-to/v1/cv_container.md - - Manage devices: docs/how-to/v1/cv_device.md - - CV Modules v3: - - Manage configlets: docs/how-to/v3/cv_configlet_v3.md - - Manage containers: docs/how-to/v3/cv_container_v3.md - - Manage devices: docs/how-to/v3/cv_device_v3.md - - Manage images & bundles: docs/how-to/v3/cv_image_v3.md - - Manage tasks: docs/how-to/v3/cv_task_v3.md - - Manage tags: docs/how-to/v3/cv_tag_v3.md - - Manage change control: docs/how-to/v3/cv_change_control_v3.md - - Validate Configlets: docs/how-to/v3/cv_validate_v3.md - - Get facts from CloudVision: docs/how-to/v3/cv_facts_v3.md - Development tips & tricks: docs/installation/collection-installation.md - Activate logging: docs/how-to/debug.md - Schema documentation: From 263fe54a69df486959ddbfeb9d95bf2763269187 Mon Sep 17 00:00:00 2001 From: juliopdx Date: Thu, 12 Oct 2023 15:02:17 -0700 Subject: [PATCH 03/15] Corrected links --- README.md | 22 +++++++++---------- ansible_collections/arista/cvp/README.md | 28 ++++++++++++------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 77b51bbc2..6139c56d0 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,12 @@ This repository provides content for Ansible's collection **arista.cvp** with fo **Version 3:** -- [**arista.cvp.cv_configlet_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_configlet_v3.rst/) - Manage configlet configured on CVP. -- [**arista.cvp.cv_container_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_container_v3.rst/) - Manage container topology and attach configlet and devices to containers. -- [**arista.cvp.cv_device_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_device_v3.rst/) - Manage devices configured on CVP -- [**arista.cvp.cv_task_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_task_v3.rst/) - Run tasks created on CVP. -- [**arista.cvp.cv_facts_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_facts_v3.rst/) - Collect information from CloudVision. -- [**arista.cvp.cv_image_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_image_v3.rst/) - Create EOS images and bundles on CloudVision. +- [**arista.cvp.cv_configlet_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_configlet_v3.md) - Manage configlet configured on CVP. +- [**arista.cvp.cv_container_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_container_v3.md) - Manage container topology and attach configlet and devices to containers. +- [**arista.cvp.cv_device_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_device_v3.md) - Manage devices configured on CVP +- [**arista.cvp.cv_task_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_task_v3.md) - Run tasks created on CVP. +- [**arista.cvp.cv_facts_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_facts_v3.md) - Collect information from CloudVision. +- [**arista.cvp.cv_image_v3**](https://cvp.avd.sh/en/latest/docs/modules/cv_image_v3.md) - Create EOS images and bundles on CloudVision. ### List of available roles @@ -45,11 +45,11 @@ This repository provides content for Ansible's collection **arista.cvp** with fo ## Deprecated modules -- [**arista.cvp.cv_facts**](https://cvp.avd.sh/en/latest/docs/modules/cv_facts.rst/) - Collect CVP facts from server like list of containers, devices, configlet and tasks. -- [**arista.cvp.cv_configlet**](https://cvp.avd.sh/en/latest/docs/modules/cv_configlet.rst/) - Manage configlet configured on CVP. -- [**arista.cvp.cv_container**](https://cvp.avd.sh/en/latest/docs/modules/cv_container.rst/) - Manage container topology and attach configlet and devices to containers. -- [**arista.cvp.cv_device**](https://cvp.avd.sh/en/latest/docs/modules/cv_device.rst/) - Manage devices configured on CVP -- [**arista.cvp.cv_task**](https://cvp.avd.sh/en/latest/docs/modules/cv_task.rst/) - Run tasks created on CVP. +- [**arista.cvp.cv_facts**](https://cvp.avd.sh/en/latest/docs/modules/cv_facts.md) - Collect CVP facts from server like list of containers, devices, configlet and tasks. +- [**arista.cvp.cv_configlet**](https://cvp.avd.sh/en/latest/docs/modules/cv_configlet.md) - Manage configlet configured on CVP. +- [**arista.cvp.cv_container**](https://cvp.avd.sh/en/latest/docs/modules/cv_container.md) - Manage container topology and attach configlet and devices to containers. +- [**arista.cvp.cv_device**](https://cvp.avd.sh/en/latest/docs/modules/cv_device.md) - Manage devices configured on CVP +- [**arista.cvp.cv_task**](https://cvp.avd.sh/en/latest/docs/modules/cv_task.md) - Run tasks created on CVP. ## Example diff --git a/ansible_collections/arista/cvp/README.md b/ansible_collections/arista/cvp/README.md index af69210fc..0ba7a8ef9 100644 --- a/ansible_collections/arista/cvp/README.md +++ b/ansible_collections/arista/cvp/README.md @@ -79,15 +79,15 @@ This repository provides content for Ansible's collection **arista.cvp** with fo **Version 3:** -- [**arista.cvp.cv_configlet_v3**](docs/modules/cv_configlet_v3.rst/) - Manage configlet configured on CVP. -- [**arista.cvp.cv_container_v3**](docs/modules/cv_container_v3.rst/) - Manage container topology and attach configlet and devices to containers. -- [**arista.cvp.cv_device_v3**](docs/modules/cv_device_v3.rst/) - Manage devices configured on CVP -- [**arista.cvp.cv_task_v3**](docs/modules/cv_task_v3.rst/) - Run tasks created on CVP. -- [**arista.cvp.cv_facts_v3**](docs/modules/cv_facts_v3.rst/) - Collect information from CloudVision. -- [**arista.cvp.cv_image_v3**](docs/modules/cv_image_v3.rst/) - Create EOS images and bundles on CloudVision. -- [**arista.cvp.cv_tag_v3**](docs/modules/cv_tag_v3.rst/) - Create, delete, assign and unassign tags on CloudVision. -- [**arista.cvp.cv_validate_v3**](docs/modules/cv_validate_v3.rst/) - Configlet validation -- [**arista.cvp.cv_change_control_v3**](docs/modules/cv_change_control_v3.rst/) - Manage change controls on CloudVision. +- [**arista.cvp.cv_configlet_v3**](docs/modules/cv_configlet_v3.md) - Manage configlet configured on CVP. +- [**arista.cvp.cv_container_v3**](docs/modules/cv_container_v3.md) - Manage container topology and attach configlet and devices to containers. +- [**arista.cvp.cv_device_v3**](docs/modules/cv_device_v3.md) - Manage devices configured on CVP +- [**arista.cvp.cv_task_v3**](docs/modules/cv_task_v3.md) - Run tasks created on CVP. +- [**arista.cvp.cv_facts_v3**](docs/modules/cv_facts_v3.md) - Collect information from CloudVision. +- [**arista.cvp.cv_image_v3**](docs/modules/cv_image_v3.md) - Create EOS images and bundles on CloudVision. +- [**arista.cvp.cv_tag_v3**](docs/modules/cv_tag_v3.md) - Create, delete, assign and unassign tags on CloudVision. +- [**arista.cvp.cv_validate_v3**](docs/modules/cv_validate_v3.md) - Configlet validation +- [**arista.cvp.cv_change_control_v3**](docs/modules/cv_change_control_v3.md) - Manage change controls on CloudVision. ### List of available roles @@ -96,11 +96,11 @@ This repository provides content for Ansible's collection **arista.cvp** with fo ### Deprecated modules -- [**arista.cvp.cv_facts**](docs/modules/cv_facts.rst/) - Collect CVP facts from server like list of containers, devices, configlet and tasks. -- [**arista.cvp.cv_configlet**](docs/modules/cv_configlet.rst/) - Manage configlet configured on CVP. -- [**arista.cvp.cv_container**](docs/modules/cv_container.rst/) - Manage container topology and attach configlet and devices to containers. -- [**arista.cvp.cv_device**](docs/modules/cv_device.rst/) - Manage devices configured on CVP -- [**arista.cvp.cv_task**](docs/modules/cv_task.rst/) - Run tasks created on CVP. +- [**arista.cvp.cv_facts**](docs/modules/cv_facts.md) - Collect CVP facts from server like list of containers, devices, configlet and tasks. +- [**arista.cvp.cv_configlet**](docs/modules/cv_configlet.md) - Manage configlet configured on CVP. +- [**arista.cvp.cv_container**](docs/modules/cv_container.md) - Manage container topology and attach configlet and devices to containers. +- [**arista.cvp.cv_device**](docs/modules/cv_device.md) - Manage devices configured on CVP +- [**arista.cvp.cv_task**](docs/modules/cv_task.md) - Run tasks created on CVP. ## Example From 8eec92e95af28fc74c67236e89804793ee120987 Mon Sep 17 00:00:00 2001 From: juliopdx Date: Thu, 12 Oct 2023 15:23:56 -0700 Subject: [PATCH 04/15] pre-commit and more link fixes --- .../arista/cvp/docs/modules/cv_change_control_v3.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_configlet.md | 2 +- .../arista/cvp/docs/modules/cv_configlet_v3.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_container.md | 2 +- .../arista/cvp/docs/modules/cv_container_v3.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_device.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_device_v3.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_facts.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_image_v3.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_task.md | 2 +- ansible_collections/arista/cvp/docs/modules/cv_task_v3.md | 2 +- .../arista/cvp/docs/modules/cv_validate_v3.md | 2 +- ansible_collections/arista/cvp/docs/release-notes/v3.x.md | 6 +++--- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md index 7d0b449de..dfa0b60dd 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md @@ -133,4 +133,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet.md index a49b471a9..538454146 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_configlet.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_configlet.md @@ -74,4 +74,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md index 73fea8c2a..3b98e4890 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md @@ -62,4 +62,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_container.md b/ansible_collections/arista/cvp/docs/modules/cv_container.md index cb14371e7..db7ff6a21 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_container.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_container.md @@ -68,4 +68,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md index b02cdd120..f6cd28bbc 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md @@ -81,4 +81,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_device.md b/ansible_collections/arista/cvp/docs/modules/cv_device.md index 7e77315d4..9effb9a3c 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_device.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_device.md @@ -94,4 +94,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md index 28108f700..0ff64a8d4 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_device_v3.md @@ -173,4 +173,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_facts.md b/ansible_collections/arista/cvp/docs/modules/cv_facts.md index 5fd64bf8b..f5ad6b13d 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_facts.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_facts.md @@ -68,4 +68,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md index e3291a10f..e58f05ccf 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md @@ -84,4 +84,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md index 2c05ad988..4c6115f19 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_image_v3.md @@ -74,4 +74,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md index ec41c9674..dfc737f26 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md @@ -184,4 +184,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_task.md b/ansible_collections/arista/cvp/docs/modules/cv_task.md index 6c06bb0fd..1611c05ec 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_task.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_task.md @@ -51,4 +51,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md index e75eacc5a..788019f45 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md @@ -38,4 +38,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md index e99cbe5e9..f37d3f3ff 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_validate_v3.md @@ -77,4 +77,4 @@ For a complete list of examples, check them out on our [GitHub repository](https ## Author -Ansible Arista Team (@aristanetworks) \ No newline at end of file +Ansible Arista Team (@aristanetworks) diff --git a/ansible_collections/arista/cvp/docs/release-notes/v3.x.md b/ansible_collections/arista/cvp/docs/release-notes/v3.x.md index 94974f76c..b0c99af70 100644 --- a/ansible_collections/arista/cvp/docs/release-notes/v3.x.md +++ b/ansible_collections/arista/cvp/docs/release-notes/v3.x.md @@ -200,7 +200,7 @@ pip install --upgrade cvprac>=1.0.7 ### New Features -- New module to manage devices: [cv_device_v3](../../how-to/v3/cv_configlet_v3/) +- New module to manage devices: [cv_device_v3](../../docs/modules/cv_configlet_v3.md) ```yaml - name: "Configure devices on {{inventory_hostname}}" @@ -209,7 +209,7 @@ pip install --upgrade cvprac>=1.0.7 register: CVP_DEVICES_RESULTS ``` -- New module to manage containers: [cv_container_v3](../../how-to/v3/cv_container_v3/) +- New module to manage containers: [cv_container_v3](../../docs/modules/cv_container_v3.md) ```yaml - name: "Configure containers on {{inventory_hostname}}" @@ -217,7 +217,7 @@ pip install --upgrade cvprac>=1.0.7 topology: "{{CVP_CONTAINERS}}" ``` -- New module to manage configlets: [cv_configlet_v3](../../how-to/v3/cv_configlet_v3/) +- New module to manage configlets: [cv_configlet_v3](../../docs/modules/cv_configlet_v3.md) ```yaml - name: Configure configlets From be22858e212ec3bb3ff236fb14e2a318d4018e00 Mon Sep 17 00:00:00 2001 From: juliopdx Date: Fri, 13 Oct 2023 12:09:31 -0700 Subject: [PATCH 05/15] updated build script to handle ansible-test errors, removed invalid keys from module. --- .../arista/cvp/docs/build-md/doc.py | 34 +++++++++++++++++-- .../arista/cvp/docs/build-md/templates/md.j2 | 8 ++--- .../cvp/docs/modules/cv_change_control_v3.md | 8 ----- .../arista/cvp/docs/modules/cv_task_v3.md | 8 +++++ .../plugins/modules/cv_change_control_v3.py | 2 -- .../cvp/plugins/modules/cv_configlet.py | 1 - .../cvp/plugins/modules/cv_configlet_v3.py | 1 - .../cvp/plugins/modules/cv_container.py | 1 - .../cvp/plugins/modules/cv_container_v3.py | 2 -- .../arista/cvp/plugins/modules/cv_device.py | 1 - .../cvp/plugins/modules/cv_device_v3.py | 2 -- .../arista/cvp/plugins/modules/cv_facts.py | 1 - .../arista/cvp/plugins/modules/cv_facts_v3.py | 1 - .../arista/cvp/plugins/modules/cv_tag_v3.py | 2 -- .../cvp/plugins/modules/cv_validate_v3.py | 2 -- 15 files changed, 44 insertions(+), 30 deletions(-) diff --git a/ansible_collections/arista/cvp/docs/build-md/doc.py b/ansible_collections/arista/cvp/docs/build-md/doc.py index 5465c9767..5e580adf9 100644 --- a/ansible_collections/arista/cvp/docs/build-md/doc.py +++ b/ansible_collections/arista/cvp/docs/build-md/doc.py @@ -1,3 +1,21 @@ +#!/usr/bin/python +# coding: utf-8 -*- +# +# Copyright 2023 Arista Networks +# +# 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 from pathlib import Path @@ -13,15 +31,27 @@ def jinja2_writer(template_dir, name, data): env = Environment( loader=FileSystemLoader(template_dir), trim_blocks=True, + keep_trailing_newline=True ) template = env.get_template("md.j2") name = name.removesuffix(".py") filename = f"{name}.md" + try: + Path(f"../schema/{name}.md").read_text(encoding="UTF-8") + schema = f"../schema/{name}.md" + except FileNotFoundError: + schema = None + + try: + Path(f"../outputs/{name}.txt").read_text(encoding="UTF-8") + module_output = f"docs/outputs/{name}.txt" + except FileNotFoundError: + module_output = None + content = template.render( - module=data, - name=name, + module=data, name=name, schema=schema, module_output=module_output ) with open(os.path.join(OUTPUTDIR, filename), mode="w", encoding="utf-8") as file: file.write(content) diff --git a/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 b/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 index 801d33649..45f3acb53 100644 --- a/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 +++ b/ansible_collections/arista/cvp/docs/build-md/templates/md.j2 @@ -26,10 +26,10 @@ The following options may be specified for this module: {% endif %} {% endfor %} -{% if module.doc.schema %} +{% if schema %} ## Inputs -For a full view of the module inputs, please see the [schema documentation]({{ module.doc.schema }}). +For a full view of the module inputs, please see the [schema documentation]({{ schema }}). {% endif %} ## Examples @@ -46,13 +46,13 @@ For a full view of the module inputs, please see the [schema documentation]({{ m For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). -{% if module.doc.module_output %} +{% if module_output %} ## Module output ??? output "Example output" ```yaml --8<-- - {{ module.doc.module_output }} + {{ module_output }} --8<-- ``` {% endif %} diff --git a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md index dfa0b60dd..e702e4c51 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md @@ -122,14 +122,6 @@ For a full view of the module inputs, please see the [schema documentation](../s For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). -## Module output - -??? output "Example output" - ```yaml - --8<-- - docs/outputs/change_control_v3.txt - --8<-- - ``` ## Author diff --git a/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md index 788019f45..737c3f2f6 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_task_v3.md @@ -35,6 +35,14 @@ The following options may be specified for this module: For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). +## Module output + +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_task_v3.txt + --8<-- + ``` ## Author diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_change_control_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_change_control_v3.py index 591ba2a74..1d34d02ef 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_change_control_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_change_control_v3.py @@ -25,8 +25,6 @@ module: cv_change_control_v3 version_added: 3.4.0 author: Ansible Arista Team (@aristanetworks) -schema: ../schema/cv_change_control_v3.md -module_output: docs/outputs/change_control_v3.txt short_description: Change Control management with CloudVision description: - CloudVision Portal change control module. diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py b/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py index 49a9c5765..fecbbd532 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_configlet.py @@ -26,7 +26,6 @@ module: cv_configlet version_added: "1.0.0" author: Ansible Arista Team (@aristanetworks) -module_output: docs/outputs/cv_configlet.txt short_description: Create, Delete, or Update CloudVision Portal Configlets. description: - CloudVison Portal Configlet compares the list of configlets and config in diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py index 1ff3abd30..0fd6e354c 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py @@ -27,7 +27,6 @@ module: cv_configlet_v3 version_added: "3.0.0" author: Ansible Arista Team (@aristanetworks) -module_output: docs/outputs/cv_configlet_v3.txt short_description: Create, Delete, or Update CloudVision Portal Configlets. description: - CloudVison Portal Configlet compares the list of configlets and config in diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_container.py b/ansible_collections/arista/cvp/plugins/modules/cv_container.py index b69f1ac73..700f4406f 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_container.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_container.py @@ -27,7 +27,6 @@ module: cv_container version_added: "1.0.0" author: Ansible Arista Team (@aristanetworks) -module_output: docs/outputs/cv_container.txt short_description: Manage Provisioning topology. description: - CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py index 502df5bb3..c21579098 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py @@ -31,8 +31,6 @@ module: cv_container_v3 version_added: "3.0.0" author: Ansible Arista Team (@aristanetworks) -schema: ../schema/cv_container_v3.md -module_output: docs/outputs/cv_container_v3.txt short_description: Manage Provisioning topology. description: - CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_device.py b/ansible_collections/arista/cvp/plugins/modules/cv_device.py index b4cc21617..42cc57554 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_device.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_device.py @@ -24,7 +24,6 @@ module: cv_device version_added: "1.0.0" author: Ansible Arista Team (@aristanetworks) -module_output: docs/outputs/cv_device.txt short_description: Provision, Reset, or Update CloudVision Portal Devices. description: - CloudVision Portal Device compares the list of Devices diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py index 63e193942..20d15c889 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py @@ -27,8 +27,6 @@ module: cv_device_v3 version_added: "3.0.0" author: Ansible Arista Team (@aristanetworks) -schema: ../schema/cv_device_v3.md -module_output: docs/outputs/cv_device_v3.txt short_description: Manage Provisioning topology. description: - CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_facts.py b/ansible_collections/arista/cvp/plugins/modules/cv_facts.py index 327e733d4..2f7b17c83 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_facts.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_facts.py @@ -26,7 +26,6 @@ module: cv_facts version_added: "1.0.0" author: Ansible Arista Team (@aristanetworks) -module_output: docs/outputs/cv_facts.txt short_description: Collect facts from CloudVision Portal. deprecated: removed_in: '4.0.0' diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py index fa6c1e8ee..470353f96 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_facts_v3.py @@ -26,7 +26,6 @@ module: cv_facts_v3 version_added: "3.3.0" author: Ansible Arista Team (@aristanetworks) -module_output: docs/outputs/cv_facts_v3.txt short_description: Collect facts from CloudVision description: - Returns list of devices, configlets, containers, images and tasks from CloudVision diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py index 9b97ca8ca..9931bc7e8 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_tag_v3.py @@ -25,8 +25,6 @@ module: cv_tag_v3 version_added: "3.4.0" author: Ansible Arista Team (@aristanetworks) -schema: ../schema/cv_tag_v3.md -module_output: docs/outputs/cv_tag_v3.txt short_description: Create/Assign/Delete/Unassign tags on CVP description: - CloudVision Portal Tag module to Create/Assign/Delete/Unassign tags on CloudVision diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py index 8dc664d41..1b47122af 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py @@ -25,8 +25,6 @@ module: cv_validate_v3 version_added: "3.7.0" author: Ansible Arista Team (@aristanetworks) -schema: ../schema/cv_validate_v3.md -module_output: docs/outputs/cv_validate_v3.txt short_description: CVP/Local configlet Validation description: - CloudVision Portal Validate module to Validate configlets against a device on CVP. From b2579a1564fa2e244ed0429966584587a13d2263 Mon Sep 17 00:00:00 2001 From: juliopdx Date: Fri, 13 Oct 2023 12:23:50 -0700 Subject: [PATCH 06/15] Non required shebang --- .../arista/cvp/docs/build-md/doc.py | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/ansible_collections/arista/cvp/docs/build-md/doc.py b/ansible_collections/arista/cvp/docs/build-md/doc.py index 5e580adf9..ce4de6de3 100644 --- a/ansible_collections/arista/cvp/docs/build-md/doc.py +++ b/ansible_collections/arista/cvp/docs/build-md/doc.py @@ -1,21 +1,3 @@ -#!/usr/bin/python -# coding: utf-8 -*- -# -# Copyright 2023 Arista Networks -# -# 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 from pathlib import Path @@ -31,7 +13,7 @@ def jinja2_writer(template_dir, name, data): env = Environment( loader=FileSystemLoader(template_dir), trim_blocks=True, - keep_trailing_newline=True + keep_trailing_newline=True, ) template = env.get_template("md.j2") From 24928e578d789599d6185e6727b5daf94cf15a83 Mon Sep 17 00:00:00 2001 From: JulioPDX Date: Tue, 7 Nov 2023 11:34:24 -0800 Subject: [PATCH 07/15] updates to link checking --- .github/workflows/pull-request-management.yml | 10 ++++------ development/docker-compose.yml | 18 ++++-------------- development/entrypoint.sh | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 development/entrypoint.sh diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 66ce2e5e5..1c8566c16 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -215,18 +215,16 @@ jobs: runs-on: ubuntu-latest needs: [file-changes] if: needs.file-changes.outputs.docs == 'true' + timeout-minutes: 10 steps: - uses: actions/checkout@v3 - name: 'start docker-compose stack' run: | - cp development/docker-compose.yml . - sed -i 's/cd\sansible-cvp\/\s\&\&//g' docker-compose.yml - docker-compose -f docker-compose.yml up -d webdoc_cvp - docker-compose -f docker-compose.yml ps + docker-compose -f development/docker-compose.yml up -d webdoc_cvp + docker-compose -f development/docker-compose.yml ps - name: 'test connectivity to mkdoc server' run: | - sleep 30 - until docker exec webdoc_cvp curl -s -I http://localhost:8000/ ; do sleep 2; done + bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' 127.0.0.1:8000)" != "200" ]]; do sleep 5; done' - name: check links for 404 run: | docker run --network container:webdoc_cvp raviqqe/muffet:2.6.1 http://127.0.0.1:8000 \ diff --git a/development/docker-compose.yml b/development/docker-compose.yml index ab9b686aa..140e6fd84 100644 --- a/development/docker-compose.yml +++ b/development/docker-compose.yml @@ -14,21 +14,11 @@ services: command: [ "/bin/sh", "-c", "while true; do sleep 30; done;" ] webdoc_cvp: - image: titom73/mkdocs:latest + image: python:3.11.0-alpine3.17 container_name: webdoc_cvp + working_dir: /data volumes: - - ${PWD}/:/docs - ports: - - 8001:8000 - entrypoint: "" - command: ["sh", "-c", "cd ansible-cvp/ && pip install -r ansible_collections/arista/cvp/docs/requirements.txt && mkdocs serve --no-livereload --dev-addr=0.0.0.0:8000 -f mkdocs.yml"] - - webdoc_avd: - image: titom73/mkdocs:latest - container_name: webdoc_avd - volumes: - - ${PWD}/:/docs + - ${PWD}/:/data ports: - 8000:8000 - entrypoint: "" - command: ["sh", "-c", "cd ansible-avd/ && pip install -r ansible_collections/arista/avd/docs/requirements.txt && mkdocs serve --no-livereload --dev-addr=0.0.0.0:8000 -f mkdocs.yml"] + entrypoint: "sh /data/development/entrypoint.sh" diff --git a/development/entrypoint.sh b/development/entrypoint.sh new file mode 100644 index 000000000..5d9161ddf --- /dev/null +++ b/development/entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# Installing git +echo "Installing dependencies" +apk add --no-cache git git-fast-import + +# Making /data and /site safe for git +git config --global --add safe.directory /data +git config --global --add safe.directory /site + +# install pip requirements +echo "Installing Python requirements" +pip install -r ansible_collections/arista/cvp/docs/requirements.txt --upgrade + +# Start mkdocs +echo "Starting mkdocs" +mkdocs serve --no-livereload --dev-addr=0.0.0.0:8000 -f mkdocs.yml From 0a3e680c255da5f8b3f02c6a4c1a95647b962d9b Mon Sep 17 00:00:00 2001 From: JulioPDX Date: Tue, 7 Nov 2023 11:36:50 -0800 Subject: [PATCH 08/15] corrected down command in compose --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 1c8566c16..b950e3625 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -240,7 +240,7 @@ jobs: --timeout=30 - name: 'stop docker-compose stack' run: | - docker-compose -f docker-compose.yml down + docker-compose -f development/docker-compose.yml down ansible_test: name: Run ansible-test validation From adb87a2bcbdbbf1e23e65b495272107dbfc502a2 Mon Sep 17 00:00:00 2001 From: JulioPDX Date: Wed, 8 Nov 2023 11:57:31 -0800 Subject: [PATCH 09/15] add change control v3 output --- .../cvp/docs/modules/cv_change_control_v3.md | 8 ++ .../cvp/docs/outputs/cv_change_control_v3.txt | 130 ++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 ansible_collections/arista/cvp/docs/outputs/cv_change_control_v3.txt diff --git a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md index e702e4c51..d06bbe8c3 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_change_control_v3.md @@ -122,6 +122,14 @@ For a full view of the module inputs, please see the [schema documentation](../s For a complete list of examples, check them out on our [GitHub repository](https://github.com/aristanetworks/ansible-cvp/tree/devel/ansible_collections/arista/cvp/examples). +## Module output + +??? output "Example output" + ```yaml + --8<-- + docs/outputs/cv_change_control_v3.txt + --8<-- + ``` ## Author diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_change_control_v3.txt b/ansible_collections/arista/cvp/docs/outputs/cv_change_control_v3.txt new file mode 100644 index 000000000..8e64950d0 --- /dev/null +++ b/ansible_collections/arista/cvp/docs/outputs/cv_change_control_v3.txt @@ -0,0 +1,130 @@ +TASK [SHOW output] ************************************************************** +ok: [CloudVision] => + msg: + changed: false + data: + change_controls: + - time: '2023-11-08T19:47:46.275176691Z' + value: + change: + name: s1-leaf 2A Change Control + notes: Initiated from Ansible Playbook + rootStageId: cfd63c69-c218-403d-8c76-2f6544b3d336 + stages: + values: + a8b8db7e-fc5b-4966-8290-6caaab0c524e: + name: LEAF2A_MLAG_Health + rows: + values: + - values: + - be136747-9dba-4325-a309-e4616d590de1 + be136747-9dba-4325-a309-e4616d590de1: + action: + args: + values: + DeviceID: SN-DC1-POD1-LEAF2A + name: mlaghealthcheck + name: Check_LEAF2A_MLAG_Health + rows: {} + cfd63c69-c218-403d-8c76-2f6544b3d336: + name: s1-leaf 2A Change Control root stage + rows: + values: + - values: + - a8b8db7e-fc5b-4966-8290-6caaab0c524e + time: '2023-11-08T19:47:46.275176691Z' + user: cvpadmin + deviceIds: + values: + - SN-DC1-POD1-LEAF2A + key: + id: 1c5db627-d9cf-4a8f-8f10-b429c778d8ef + failed: false +TASK [SET output] *************************************************************** +ok: [CloudVision] => + msg: + changed: true + data: + id: 06e192e0-74b8-4e79-b275-7f3cc04bff7a + failed: false +TASK [APPROVE output] *********************************************************** +ok: [CloudVision] => + msg: + changed: true + data: + time: '2023-11-08T19:33:30.177118624Z' + value: + approve: + notes: Initiated from Ansible Playbook + value: true + key: + id: 06e192e0-74b8-4e79-b275-7f3cc04bff7a + version: '2023-11-08T19:33:24.518784086Z' + failed: false +TASK [UNAPPROVE output] ********************************************************* +ok: [CloudVision] => + msg: + changed: true + data: + time: '2023-11-08T19:45:07.908390315Z' + value: + approve: + notes: Initiated from Ansible Playbook + value: false + key: + id: af2a25f6-c929-49a5-9e3c-8ba0eb551b0d + version: '2023-11-08T19:45:01.555350127Z' + failed: false +TASK [EXECUTE output] *********************************************************** +ok: [CloudVision] => + msg: + changed: true + data: + time: '2023-11-08T19:33:35.786232908Z' + value: + key: + id: 06e192e0-74b8-4e79-b275-7f3cc04bff7a + start: + notes: '' + value: true + failed: false +TASK [SCHEDULE output] ********************************************************** +ok: [CloudVision] => + msg: + changed: true + data: + time: '2023-11-08T19:39:24.208236092Z' + value: + key: + id: 09292183-8c6c-4c0a-9098-7f3f18f635b2 + schedule: + notes: '' + value: '2024-06-15T15:47:00Z' + failed: false +TASK [APPROVE AND EXECUTE] ****************************************************** +ok: [CloudVision] => + msg: + changed: true + data: + time: '2023-11-08T19:33:52.673472540Z' + value: + key: + id: a6675eb7-fed9-4d5d-b157-6533be697472 + start: + notes: '' + value: true + failed: false +TASK [SCHEDULE AND APPROVE output] ********************************************** +ok: [CloudVision] => + msg: + changed: true + data: + time: '2023-11-08T19:39:43.875892258Z' + value: + approve: + notes: Initiated from Ansible Playbook + value: true + key: + id: 3b64e94f-8cac-4bb6-80f5-fd7e2736c976 + version: '2023-11-08T19:39:40.756528116Z' + failed: false From 14b107af26773086264ea8e02f4860611ceaa03d Mon Sep 17 00:00:00 2001 From: JulioPDX Date: Wed, 8 Nov 2023 12:47:35 -0800 Subject: [PATCH 10/15] add remove output in change control --- .../arista/cvp/docs/outputs/cv_change_control_v3.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ansible_collections/arista/cvp/docs/outputs/cv_change_control_v3.txt b/ansible_collections/arista/cvp/docs/outputs/cv_change_control_v3.txt index 8e64950d0..ebcf43e0b 100644 --- a/ansible_collections/arista/cvp/docs/outputs/cv_change_control_v3.txt +++ b/ansible_collections/arista/cvp/docs/outputs/cv_change_control_v3.txt @@ -128,3 +128,12 @@ ok: [CloudVision] => id: 3b64e94f-8cac-4bb6-80f5-fd7e2736c976 version: '2023-11-08T19:39:40.756528116Z' failed: false +TASK [Remove by name output] ************************************************************ +ok: [CloudVision] => + msg: + changed: true + data: + - key: + id: DV8HoPbPX_WzIa5-6y1gy + time: '2023-11-08T20:39:38.691470915Z' + failed: false From f1873e2c07d13f4e5ac58b93d60fdfd66790c015 Mon Sep 17 00:00:00 2001 From: JulioPDX Date: Wed, 8 Nov 2023 15:46:59 -0800 Subject: [PATCH 11/15] Minor grammar and version table edits --- ansible_collections/arista/cvp/README.md | 35 ++++++++++--------- .../cvp/docs/installation/requirements.md | 17 ++++----- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/ansible_collections/arista/cvp/README.md b/ansible_collections/arista/cvp/README.md index 0ba7a8ef9..cafddd5df 100644 --- a/ansible_collections/arista/cvp/README.md +++ b/ansible_collections/arista/cvp/README.md @@ -2,13 +2,13 @@ ## About -[Arista Networks](https://www.arista.com/) supports Ansible for managing devices running the EOS operating system through [CloudVision platform (CVP)](https://www.arista.com/en/products/eos/eos-cloudvision). This collection includes a set of ansible modules that perform specific configuration tasks on CVP server. These tasks include: collecting facts, managing configlets, building topology with containers and devices, running tasks. +[Arista Networks](https://www.arista.com/) supports Ansible for managing devices running the EOS operating system through [CloudVision platform (CVP)](https://www.arista.com/en/products/eos/eos-cloudvision). This collection includes a set of Ansible modules that perform specific configuration tasks on a CVP server. These tasks include collecting facts, managing configlets, building topology with containers and devices, and running tasks.

Arista CloudVision and Ansible

-Even if **`arista.cvp`** collection is integrated with `arista.avd` collection to [automate configuration deployment](https://avd.sh/en/latest/roles/eos_config_deploy_cvp/index.html), this collection can also be used outside of AVD tasks to populate your CloudVision server with your own workflows. +Even if **`arista.cvp`** collection is integrated with `arista.avd` collection to [automate configuration deployment](https://avd.sh/en/latest/roles/eos_config_deploy_cvp/index.html), this collection can also be used outside of AVD tasks to populate your CloudVision server with your workflows. ## Requirements @@ -16,23 +16,24 @@ Even if **`arista.cvp`** collection is integrated with `arista.avd` collection t Current active branch: -- **CVP 2020.2.x and onward**: starting version [`ansible-cvp 2.0.0`](https://github.com/aristanetworks/ansible-cvp/releases/tag/v2.0.0) +- **CVP 2021.3.x and onward**: starting with `ansible-cvp 3.9.0` !!! info - Starting version 2.0.0, collection uses [cvprac](https://github.com/aristanetworks/cvprac) as CloudVision connection manager. So support for any new CLoudvision server is tied to it support in this python library. + Starting with version 2.0.0, the collection uses [cvprac](https://github.com/aristanetworks/cvprac) as the CloudVision connection manager. So support for any new CloudVision server is tied to it's support in the cvprac Python library. -| ansible-cvp | 1.0.0 | 1.1.0 | >= 2.0.0 | -| ----------- | ----- | ----- | -------- | -| 2018.2 | ✅ | ✅ | ✅ | -| 2019.x | ✅ | ✅ | ✅ | -| 2020.1 | | ✅ | ✅ | -| >= 2020.2 | | | ✅ | +| ansible-cvp | 1.0.0 | 1.1.0 | >= 2.0.0 |>= 3.9.0 | +| ----------- | ----- | ----- | -------- | -------- | +| 2018.2 | ✅ | ✅ | ✅ | | +| 2019.x | ✅ | ✅ | ✅ | | +| 2020.1 | | ✅ | ✅ | | +| >= 2020.2 | | | ✅ | | +| >= 2021.3 | | | | ✅ | ### Python - Python `>=3.8` -Please check the minimum version supported by your ansible installation on [ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#control-node-requirements) +Please check the minimum version supported by your ansible installation on the [ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#control-node-requirements). ### Additional Python Libraries required @@ -104,13 +105,13 @@ This repository provides content for Ansible's collection **arista.cvp** with fo ## Example -This example outlines how to use `arista.cvp` to create a containers topology on Arista CloudVision. +This example outlines how to use `arista.cvp` to create a container's topology on Arista CloudVision. -A dedicated repository is available for step by step examples on [ansible-cvp-toi](https://github.com/arista-netdevops-community/ansible-cvp-toi). +A dedicated repository is available for step-by-step examples on [ansible-cvp-toi](https://github.com/arista-netdevops-community/ansible-cvp-toi). -A [complete end to end demo](https://github.com/arista-netdevops-community/ansible-avd-cloudvision-demo) using [Arista Validated Design collection](https://github.com/aristanetworks/ansible-avd) and CloudVision modules is available as an example. +A [complete end-to-end demo](https://github.com/arista-netdevops-community/ansible-avd-cloudvision-demo) using [Arista Validated Design collection](https://github.com/aristanetworks/ansible-avd) and CloudVision modules is available as an example. -Below is a very basic example to build a container topology on a CloudVision platform assuming you have 3 veos named `veos0{1,3}` and a configlet named `alias` +Below is a very basic example of build a container topology on a CloudVision platform, assuming you have three vEOS named `veos0{1,3}` and a configlet named `alias`. ```yaml --- @@ -182,7 +183,7 @@ As modules of this collection are based on [`HTTPAPI` connection plugin](https:/ ## License -Project is published under [Apache License](LICENSE). +The project is published under [Apache License](LICENSE). ## Ask a question @@ -190,7 +191,7 @@ To report a bug, discuss or request a specific feature, please open a [GitHub is ## Contributing -Contributing pull requests are gladly welcomed for this repository. If you are planning a big change, please start a discussion first to make sure we'll be able to merge it. +Contributing pull requests are gladly welcomed for this repository. If you are planning a significant change, please start a discussion first to ensure we can merge it. You can also open an [issue](https://github.com/aristanetworks/ansible-cvp/issues) to report any problem or to submit enhancement. diff --git a/ansible_collections/arista/cvp/docs/installation/requirements.md b/ansible_collections/arista/cvp/docs/installation/requirements.md index a8843d347..af82f570e 100644 --- a/ansible_collections/arista/cvp/docs/installation/requirements.md +++ b/ansible_collections/arista/cvp/docs/installation/requirements.md @@ -8,14 +8,15 @@ ## Arista CloudVision !!! info - Starting version 2.0.0, collection uses [cvprac](https://github.com/aristanetworks/cvprac) as CloudVision connection manager. So support for any new CLoudvision server is tied to it support in this python library. - -| ansible-cvp | 1.0.0 | 1.1.0 | 2.0.0 & higher | -| ----------- | ----- | ----- | -------------- | -| 2018.2 | ✅ | ✅ | ✅ | -| 2019.x | ✅ | ✅ | ✅ | -| 2020.1 | | ✅ | ✅ | -| >= 2020.2 | | | ✅ | + Starting with version 2.0.0, the collection uses [cvprac](https://github.com/aristanetworks/cvprac) as CloudVision connection manager. So support for any new CloudVision server is tied to it's support in this Python library. + +| ansible-cvp | 1.0.0 | 1.1.0 | >= 2.0.0 |>= 3.9.0 | +| ----------- | ----- | ----- | -------- | -------- | +| 2018.2 | ✅ | ✅ | ✅ | | +| 2019.x | ✅ | ✅ | ✅ | | +| 2020.1 | | ✅ | ✅ | | +| >= 2020.2 | | | ✅ | | +| >= 2021.3 | | | | ✅ | ## Python From 3dbee0c77028aeb49da7a95f0df4ee61a5ff8893 Mon Sep 17 00:00:00 2001 From: Sugetha Chandhrasekar Date: Mon, 13 Nov 2023 15:17:17 -0800 Subject: [PATCH 12/15] merging changes from pr/589 --- .../arista/cvp/docs/modules/cv_container_v3.md | 11 +++++++---- .../arista/cvp/plugins/modules/cv_container_v3.py | 12 ++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md index f6cd28bbc..b08f20b38 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_container_v3.md @@ -6,8 +6,11 @@ Module added in version 3.0.0 ## Synopsis CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, to create and delete containers on CVP side. -Module also supports to configure configlets at container level. -Returns number of created and/or deleted containers +The Module also supports assigning configlets at the container level. +Returns number of created and/or deleted containers. +With the argument `apply_mode` set to `loose` the module will only add new containers. +When `apply_mode` is set to `strict` the module will try to remove unspecified containers from CloudVision. +This will fail if the container has configlets attached to it or devices are placed in the container. ## Module-specific Options @@ -34,7 +37,7 @@ For a full view of the module inputs, please see the [schema documentation](../s gather_facts: no vars: verbose: False - containers: + CVP_CONTAINERS: Fabric: parentContainerName: Tenant Spines: @@ -53,7 +56,7 @@ For a full view of the module inputs, please see the [schema documentation](../s gather_facts: no vars: verbose: False - containers: + CVP_CONTAINERS: Fabric: parentContainerName: Tenant Spines: diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py index c21579098..724894222 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py @@ -35,8 +35,12 @@ description: - CloudVision Portal Configlet configuration requires a dictionary of containers with their parent, to create and delete containers on CVP side. - - Module also supports to configure configlets at container level. - - Returns number of created and/or deleted containers + - The Module also supports assigning configlets at the container level. + - Returns number of created and/or deleted containers. + - With the argument `apply_mode` set to `loose` the module will only add new containers. + - When `apply_mode` is set to `strict` the module will try to remove unspecified containers from CloudVision. + - This will fail if the container has configlets attached to it or devices are placed in the container. + options: topology: description: YAML dictionary to describe intended containers. @@ -66,7 +70,7 @@ gather_facts: no vars: verbose: False - containers: + CVP_CONTAINERS: Fabric: parentContainerName: Tenant Spines: @@ -85,7 +89,7 @@ gather_facts: no vars: verbose: False - containers: + CVP_CONTAINERS: Fabric: parentContainerName: Tenant Spines: From d61fe3a1f767cd576216905daa79d74383b74cdb Mon Sep 17 00:00:00 2001 From: Carl Buchmann Date: Mon, 20 Nov 2023 16:49:31 -0500 Subject: [PATCH 13/15] update to python3 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9f5e94830..1ff7e5939 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ build-docker3: ## [DEPRECATED] visit https://github.com/arista-netdevops-communi .PHONY: webdoc webdoc: ## Build documentation to publish static content ( cd $(WEBDOC_BUILD) ; \ - python doc.py) + python3 doc.py) cp $(CURRENT_DIR)/contributing.md $(WEBDOC_BUILD)/.. ;\ .PHONY: check-cvp-404 From 124908f9255c6a10da7e37542db3553786e42016 Mon Sep 17 00:00:00 2001 From: Carl Buchmann Date: Mon, 20 Nov 2023 16:49:42 -0500 Subject: [PATCH 14/15] address feadback from review --- ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md | 2 +- .../arista/cvp/plugins/modules/cv_configlet_v3.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md index 3b98e4890..1df56fc32 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md @@ -42,7 +42,7 @@ The following options may be specified for this module: - name: 'Create configlets on CVP {{inventory_hostname}}.' tags: - provision - cv_configlet: + cv_configlet_v3: configlets: "{{configlet_list}}" configlets_notes: "Configlet managed by Ansible" register: cvp_configlet diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py index 0fd6e354c..d4e6a8b37 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py @@ -72,7 +72,7 @@ - name: 'Create configlets on CVP {{inventory_hostname}}.' tags: - provision - cv_configlet: + cv_configlet_v3: configlets: "{{configlet_list}}" configlets_notes: "Configlet managed by Ansible" register: cvp_configlet From 6d9e6985f11cfbcd2f6b0a5c85236331694429cc Mon Sep 17 00:00:00 2001 From: Sugetha Chandhrasekar Date: Mon, 20 Nov 2023 14:04:25 -0800 Subject: [PATCH 15/15] fixed configlet example --- .../arista/cvp/docs/modules/cv_configlet_v3.md | 8 +++----- .../arista/cvp/plugins/modules/cv_configlet_v3.py | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md index 1df56fc32..1330ed8ef 100644 --- a/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md +++ b/ansible_collections/arista/cvp/docs/modules/cv_configlet_v3.md @@ -39,12 +39,10 @@ The following options may be specified for this module: Test_Configlet: "! This is a Very First Testing Configlet\n!" Test_DYNAMIC_Configlet: "{{ lookup('file', 'templates/configlet_'+inventory_hostname+'.txt') }}" tasks: - - name: 'Create configlets on CVP {{inventory_hostname}}.' - tags: - - provision - cv_configlet_v3: + - name: "Push config" + arista.cvp.cv_configlet_v3: configlets: "{{configlet_list}}" - configlets_notes: "Configlet managed by Ansible" + state: present register: cvp_configlet ``` diff --git a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py index d4e6a8b37..7cd898b9c 100644 --- a/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py +++ b/ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py @@ -69,12 +69,10 @@ Test_Configlet: "! This is a Very First Testing Configlet\n!" Test_DYNAMIC_Configlet: "{{ lookup('file', 'templates/configlet_'+inventory_hostname+'.txt') }}" tasks: - - name: 'Create configlets on CVP {{inventory_hostname}}.' - tags: - - provision - cv_configlet_v3: + - name: "Push config" + arista.cvp.cv_configlet_v3: configlets: "{{configlet_list}}" - configlets_notes: "Configlet managed by Ansible" + state: present register: cvp_configlet '''