From c4ccf7b866f06dc938e9b1a7bd2e1e68c10b3a3a Mon Sep 17 00:00:00 2001 From: Ruchi Pakhle <72685035+Ruchip16@users.noreply.github.com> Date: Thu, 6 Jun 2024 19:06:53 +0530 Subject: [PATCH] Add `vrf_global` resource module (#1055) * Add vrf_global resource module - parsed state & gathered state working * separate ios_vrf_af from vrf_global * remove unwanted files * merged state working * add states & integration tests * updated argspec * updated code * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update vrf_global.py * complete work * some review comments * some review comments * CI test failures * remove unused import * review changes * use config module to reset the config * some changes * fix some typos * review changes * pre-commit run * changes * add review changes * doc changes * some updates related to doc * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Vinay M <63404819+roverflow@users.noreply.github.com> --- README.md | 1 + .../fragments/1055_add_vrf_global_module.yaml | 3 + docs/cisco.ios.ios_vrf_global_module.rst | 1253 +++++++++++++++++ meta/runtime.yml | 2 + plugins/action/vrf_global.py | 1 + .../ios/argspec/vrf_global/__init__.py | 0 .../ios/argspec/vrf_global/vrf_global.py | 99 ++ .../network/ios/config/vrf_global/__init__.py | 0 .../ios/config/vrf_global/vrf_global.py | 117 ++ .../module_utils/network/ios/facts/facts.py | 4 + .../network/ios/facts/vrf_global/__init__.py | 0 .../ios/facts/vrf_global/vrf_global.py | 72 + .../network/ios/rm_templates/vrf_global.py | 225 +++ plugins/modules/ios_vrf_global.py | 892 ++++++++++++ plugins/test/__init__.py | 0 .../targets/ios_vrf_global/defaults/main.yaml | 3 + .../targets/ios_vrf_global/meta/main.yaml | 2 + .../targets/ios_vrf_global/tasks/cli.yaml | 21 + .../targets/ios_vrf_global/tasks/main.yaml | 5 + .../ios_vrf_global/tests/cli/_parsed.cfg | 11 + .../tests/cli/_populate_config.yaml | 15 + .../tests/cli/_remove_config.yaml | 10 + .../ios_vrf_global/tests/cli/deleted.yaml | 45 + .../tests/cli/empty_config.yaml | 68 + .../ios_vrf_global/tests/cli/gathered.yaml | 22 + .../ios_vrf_global/tests/cli/merged.yaml | 54 + .../ios_vrf_global/tests/cli/overridden.yaml | 63 + .../ios_vrf_global/tests/cli/parsed.yaml | 14 + .../ios_vrf_global/tests/cli/purged.yaml | 29 + .../ios_vrf_global/tests/cli/rendered.yaml | 34 + .../ios_vrf_global/tests/cli/replaced.yaml | 55 + .../targets/ios_vrf_global/tests/cli/rtt.yaml | 77 + .../targets/ios_vrf_global/vars/main.yaml | 233 +++ .../network/ios/test_ios_vrf_global.py | 485 +++++++ 34 files changed, 3915 insertions(+) create mode 100644 changelogs/fragments/1055_add_vrf_global_module.yaml create mode 100644 docs/cisco.ios.ios_vrf_global_module.rst create mode 120000 plugins/action/vrf_global.py create mode 100644 plugins/module_utils/network/ios/argspec/vrf_global/__init__.py create mode 100644 plugins/module_utils/network/ios/argspec/vrf_global/vrf_global.py create mode 100644 plugins/module_utils/network/ios/config/vrf_global/__init__.py create mode 100644 plugins/module_utils/network/ios/config/vrf_global/vrf_global.py create mode 100644 plugins/module_utils/network/ios/facts/vrf_global/__init__.py create mode 100644 plugins/module_utils/network/ios/facts/vrf_global/vrf_global.py create mode 100644 plugins/module_utils/network/ios/rm_templates/vrf_global.py create mode 100644 plugins/modules/ios_vrf_global.py create mode 100644 plugins/test/__init__.py create mode 100644 tests/integration/targets/ios_vrf_global/defaults/main.yaml create mode 100644 tests/integration/targets/ios_vrf_global/meta/main.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tasks/cli.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tasks/main.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/_parsed.cfg create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/_populate_config.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/_remove_config.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/deleted.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/empty_config.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/gathered.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/merged.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/overridden.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/parsed.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/purged.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/rendered.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/replaced.yaml create mode 100644 tests/integration/targets/ios_vrf_global/tests/cli/rtt.yaml create mode 100644 tests/integration/targets/ios_vrf_global/vars/main.yaml create mode 100644 tests/unit/modules/network/ios/test_ios_vrf_global.py diff --git a/README.md b/README.md index ae858f82f..a411c7ee0 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ Name | Description [cisco.ios.ios_user](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_user_module.rst)|Module to manage the aggregates of local users. [cisco.ios.ios_vlans](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_vlans_module.rst)|Resource module to configure VLANs. [cisco.ios.ios_vrf](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_vrf_module.rst)|Module to configure VRF definitions. +[cisco.ios.ios_vrf_global](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_vrf_global_module.rst)|Resource module to configure global VRF definitions. [cisco.ios.ios_vxlan_vtep](https://github.com/ansible-collections/cisco.ios/blob/main/docs/cisco.ios.ios_vxlan_vtep_module.rst)|Resource module to configure VXLAN VTEP interface. diff --git a/changelogs/fragments/1055_add_vrf_global_module.yaml b/changelogs/fragments/1055_add_vrf_global_module.yaml new file mode 100644 index 000000000..e0afc510f --- /dev/null +++ b/changelogs/fragments/1055_add_vrf_global_module.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: + - Add ios_vrf_global resource module in favor of ios_vrf module (fixes - https://github.com/ansible-collections/cisco.ios/pull/1055) diff --git a/docs/cisco.ios.ios_vrf_global_module.rst b/docs/cisco.ios.ios_vrf_global_module.rst new file mode 100644 index 000000000..eb92b8d70 --- /dev/null +++ b/docs/cisco.ios.ios_vrf_global_module.rst @@ -0,0 +1,1253 @@ +.. _cisco.ios.ios_vrf_global_module: + + +************************ +cisco.ios.ios_vrf_global +************************ + +**Resource module to configure global VRF definitions.** + + +Version added: 8.0.0 + +.. contents:: + :local: + :depth: 1 + + +Synopsis +-------- +- This module provides declarative management of VRF definitions on Cisco IOS. + + + + +Parameters +---------- + +.. raw:: html + +