From 495304e9092632010b480b5f4a4f275f004cc28f Mon Sep 17 00:00:00 2001 From: Gunasekaran Tamilarasan <58520486+gunasekaran-t@users.noreply.github.com> Date: Thu, 3 Dec 2020 14:05:16 +0530 Subject: [PATCH] Version 1.1.0 (#54) * - Changes for Version 1.1.0 - Fix for github issue #53 using port range in os10_vlan members * Preparing version 1.1.0 release --- README.md | 10 +- changelogs/CHANGELOG.rst | 31 + changelogs/changelog.yaml | 30 + docs/dellemc.os10.os10_command_module.rst | 446 ++++++ docs/dellemc.os10.os10_config_module.rst | 606 ++++++++ docs/dellemc.os10.os10_facts_module.rst | 511 +++++++ galaxy.yml | 2 +- plugins/modules/os10_facts.py | 4 +- roles/os10_aaa/README.md | 2 +- roles/os10_acl/README.md | 2 +- roles/os10_bfd/README.md | 6 +- roles/os10_bgp/README.md | 465 +++++- roles/os10_bgp/templates/os10_bgp.j2 | 1252 +++++++++++------ roles/os10_bgp/tests/main.os10.yaml | 248 +++- roles/os10_copy_config/README.md | 2 +- roles/os10_dns/README.md | 2 +- roles/os10_ecmp/README.md | 2 +- roles/os10_fabric_summary/README.md | 2 +- roles/os10_flow_monitor/README.md | 2 +- roles/os10_image_upgrade/README.md | 2 +- roles/os10_interface/README.md | 15 +- .../templates/os10_interface.j2 | 15 +- roles/os10_interface/tests/main.os10.yaml | 6 +- roles/os10_lag/README.md | 2 +- roles/os10_lldp/README.md | 2 +- roles/os10_logging/README.md | 2 +- roles/os10_logging/templates/os10_logging.j2 | 2 +- roles/os10_network_validation/README.md | 2 +- roles/os10_ntp/README.md | 14 +- roles/os10_ntp/tasks/main.yml | 25 + roles/os10_ntp/templates/os10_ntp.j2 | 10 +- roles/os10_ntp/templates/os10_ntp_vrf.j2 | 18 + roles/os10_prefix_list/README.md | 2 +- roles/os10_qos/README.md | 2 +- roles/os10_raguard/README.md | 2 +- roles/os10_route_map/README.md | 4 +- roles/os10_snmp/README.md | 153 +- roles/os10_snmp/templates/os10_snmp.j2 | 393 +++++- roles/os10_system/README.md | 6 +- roles/os10_template/README.md | 2 +- roles/os10_template/tasks/main.yml | 8 +- ...show_spanning_tree_compatibility_mode.yaml | 21 + .../tasks/show_vlt_err_disabled_ports.yaml | 20 + ..._spanning_tree_compatibility_mode.template | 6 + .../os10_show_vlt_err_disabled_ports.template | 5 + roles/os10_uplink/README.md | 10 +- roles/os10_uplink/templates/os10_uplink.j2 | 41 + roles/os10_users/README.md | 2 +- roles/os10_vlan/README.md | 2 +- roles/os10_vlan/templates/os10_vlan.j2 | 8 + roles/os10_vlt/README.md | 2 +- roles/os10_vrf/README.md | 2 +- roles/os10_vrrp/README.md | 2 +- roles/os10_vxlan/README.md | 43 +- roles/os10_xstp/README.md | 2 +- tests/integration/target-prefixes.network | 1 + .../defaults/main.yaml | 0 tests/integration/targets/os10_aaa_role/tasks | 1 + .../aaa_basic/steps/01_aaa_configure.j2 | 15 + .../aaa_basic/steps/02_aaa_update.j2 | 24 + .../aaa_basic/steps/03_aaa_empty_string.j2 | 24 + .../aaa_basic/steps/04_aaa_absent.j2 | 23 + .../aaa_basic/steps/05_aaa_stateless.j2 | 20 + .../templates/aaa_basic/steps/teardown.j2 | 23 + .../os10_aaa_role/tests/aaa_basic.yaml | 0 .../targets/os10_aaa_role/vars/main.yaml | 2 + .../targets/os10_acl_role/defaults/main.yaml | 3 + tests/integration/targets/os10_acl_role/tasks | 1 + .../acl_basic/steps/01_acl_config.j2 | 23 + .../templates/acl_basic/steps/02_acl_stage.j2 | 17 + .../acl_basic/steps/03_acl_update.j2 | 31 + .../steps/04_acl_suboptions_absent.j2 | 30 + .../steps/05_acl_suboptions_stateless.j2 | 34 + .../acl_basic/steps/06_acl_absent.j2 | 7 + .../acl_basic/steps/07_acl_stateless.j2 | 24 + .../templates/acl_basic/steps/teardown.j2 | 29 + .../os10_acl_role/tests/acl_basic.yaml | 0 .../targets/os10_acl_role/vars/main.yaml | 5 + .../targets/os10_bgp_role/defaults/main.yaml | 3 + tests/integration/targets/os10_bgp_role/tasks | 1 + .../steps/01_bgp_default_vrf_config.j2 | 191 +++ .../steps/02_bgp_default_vrf_unconfig.j2 | 185 +++ .../steps/03_bgp_non_default_vrf_config.j2 | 153 ++ .../steps/04_bgp_non_default_vrf_unconfig.j2 | 147 ++ .../05_bgp_default_non_default_vrf_config.j2 | 314 +++++ ...06_bgp_default_non_default_vrf_unconfig.j2 | 313 +++++ .../templates/bgp_vrf/steps/setup.j2 | 13 + .../templates/bgp_vrf/steps/teardown.j2 | 13 + .../targets/os10_bgp_role/tests/bgp_vrf.yaml | 0 .../targets/os10_bgp_role/vars/main.yaml | 7 + .../defaults/main.yaml | 0 .../{os10_command => }/tasks/cli.yaml | 0 .../{os10_command => }/tasks/main.yaml | 0 .../tests/cli/bad_operator.yaml | 1 - .../tests/cli/contains.yaml | 3 +- .../{os10_command => }/tests/cli/invalid.yaml | 6 +- .../{os10_command => }/tests/cli/output.yaml | 2 - .../{os10_command => }/tests/cli/timeout.yaml | 1 - .../defaults/main.yaml | 0 .../os10_config/tests/cli/sublevel_block.yaml | 62 - .../os10_config/tests/cli/sublevel_exact.yaml | 66 - .../tests/cli/sublevel_strict.yaml | 63 - .../{os10_config => }/tasks/cli.yaml | 0 .../{os10_config => }/tasks/main.yaml | 0 .../{os10_config => }/tests/cli/sublevel.yaml | 4 - .../os10_config/tests/cli/sublevel_block.yaml | 58 + .../os10_config/tests/cli/sublevel_exact.yaml | 62 + .../tests/cli/sublevel_strict.yaml | 59 + .../{os10_config => }/tests/cli/toplevel.yaml | 4 - .../tests/cli/toplevel_after.yaml | 4 - .../tests/cli/toplevel_before.yaml | 4 - .../tests/cli/toplevel_nonidempotent.yaml | 4 - .../targets/os10_ecmp_role/defaults/main.yaml | 3 + .../integration/targets/os10_ecmp_role/tasks | 1 + .../ecmp_basic/steps/01_ecmp_configure.j2 | 4 + .../ecmp_basic/steps/02_ecmp_update.j2 | 4 + .../ecmp_basic/steps/03_ecmp_unconfig.j2 | 4 + .../templates/ecmp_basic/steps/teardown.j2 | 3 + .../os10_ecmp_role/tests/ecmp_basic.yaml | 0 .../targets/os10_ecmp_role/vars/main.yaml | 5 + .../targets/os10_facts/defaults/main.yaml | 2 + .../{os10_facts => }/tasks/cli.yaml | 0 .../{os10_facts => }/tasks/main.yaml | 0 .../{os10_facts => }/tests/cli/facts.yaml | 3 - .../os10_flow_monitor_role/defaults/main.yaml | 2 + .../targets/os10_flow_monitor_role/tasks | 1 + .../steps/01_flow_monitor_configure.j2 | 14 + .../steps/02_flow_monitory_update.j2 | 16 + .../steps/03_flow_monitor_options_default.j2 | 16 + .../flow_monitor_basic/steps/setup.j2 | 3 + .../flow_monitor_basic/steps/teardown.j2 | 23 + .../tests/flow_monitor_basic.yaml | 0 .../os10_flow_monitor_role/vars/main.yaml | 3 + .../os10_interface_role/defaults/main.yaml | 2 + .../targets/os10_interface_role/tasks | 1 + .../steps/01_interface_config.j2 | 6 + .../steps/02_interface_dynamic_ip.j2 | 14 + .../steps/03_interface_static_ip.j2 | 12 + .../steps/04_interface_flowcontrol.j2 | 14 + .../steps/05_interface_switchport.j2 | 17 + .../steps/06_interface_vlan.j2 | 17 + .../steps/07_interface_range.j2 | 4 + .../interface_basic/steps/teardown.j2 | 45 + .../tests/interface_basic.yaml | 0 .../os10_interface_role/vars/main.yaml | 2 + .../targets/os10_lag_role/defaults/main.yaml | 2 + tests/integration/targets/os10_lag_role/tasks | 1 + .../lag_basic/steps/01_lag_configure.j2 | 12 + .../lag_basic/steps/02_lag_update.j2 | 12 + .../lag_basic/steps/03_lag_options_reset.j2 | 12 + .../lag_basic/steps/04_lag_absent.j2 | 12 + .../templates/lag_basic/steps/teardown.j2 | 12 + .../os10_lag_role/tests/lag_basic.yaml | 0 .../targets/os10_lag_role/vars/main.yaml | 2 + .../targets/os10_lldp_role/defaults/main.yaml | 2 + .../integration/targets/os10_lldp_role/tasks | 1 + .../lldp_basic/steps/01_lldp_configure.j2 | 44 + .../lldp_basic/steps/02_lldp_update.j2 | 44 + .../steps/03_lldp_options_absent.j2 | 44 + .../templates/lldp_basic/steps/teardown.j2 | 46 + .../os10_lldp_role/tests/lldp_basic.yaml | 0 .../targets/os10_lldp_role/vars/main.yaml | 2 + .../os10_logging_role/defaults/main.yaml | 3 + .../targets/os10_logging_role/tasks | 1 + .../logging_basic/steps/01_logging_enable.j2 | 6 + .../logging_basic/steps/02_logging_update.j2 | 6 + .../logging_basic/steps/03_logging_disable.j2 | 8 + .../steps/04_logging_server_add.j2 | 12 + .../steps/05_logging_server_del.j2 | 12 + .../templates/logging_basic/steps/teardown.j2 | 11 + .../tests/logging_basic.yaml | 0 .../targets/os10_logging_role/vars/main.yaml | 5 + .../targets/os10_ntp_role/defaults/main.yaml | 2 + tests/integration/targets/os10_ntp_role/tasks | 1 + .../ntp_basic/steps/01_ntp_configure.j2 | 24 + .../ntp_basic/steps/02_ntp_update.j2 | 20 + .../steps/03_ntp_suboptions_absent.j2 | 14 + .../steps/04_ntp_suboptions_stateless.j2 | 11 + .../ntp_basic/steps/05_ntp_empty_string.j2 | 16 + .../templates/ntp_basic/steps/setup.j2 | 4 + .../templates/ntp_basic/steps/teardown.j2 | 32 + .../os10_ntp_role/tests/ntp_basic.yaml | 1 + .../targets/os10_ntp_role/vars/main.yaml | 3 + .../os10_prefix_list_role/defaults/main.yaml | 3 + .../targets/os10_prefix_list_role/tasks | 1 + .../steps/01_prefix_list_config.j2 | 17 + .../steps/02_prefix_list_update.j2 | 17 + .../steps/03_prefix_list_entry_absent.j2 | 17 + .../steps/04_prefix_list_absent.j2 | 16 + .../prefix_list_basic/steps/teardown.j2 | 16 + .../tests/prefix_list_basic.yaml | 0 .../os10_prefix_list_role/vars/main.yaml | 5 + .../targets/os10_qos_role/defaults/main.yaml | 3 + tests/integration/targets/os10_qos_role/tasks | 1 + .../qos_basic/steps/01_qos_config.j2 | 10 + .../qos_basic/steps/02_qos_update.j2 | 10 + .../qos_basic/steps/03_qos_unconfig.j2 | 10 + .../templates/qos_basic/steps/teardown.j2 | 9 + .../os10_qos_role/tests/qos_basic.yaml | 0 .../targets/os10_qos_role/vars/main.yaml | 5 + .../os10_route_map_role/defaults/main.yaml | 3 + .../targets/os10_route_map_role/tasks | 1 + .../steps/01_route_map_configure.j2 | 48 + .../steps/02_route_map_update.j2 | 48 + .../steps/03_route_map_options_unconfig.j2 | 48 + .../steps/04_route_map_unconfig.j2 | 47 + .../route_map_basic/steps/teardown.j2 | 47 + .../tests/route_map_basic.yaml | 0 .../os10_route_map_role/vars/main.yaml | 5 + .../targets/os10_snmp_role/defaults/main.yaml | 2 + .../integration/targets/os10_snmp_role/tasks | 1 + .../snmp_basic/steps/01_snmp_configure.j2 | 135 ++ .../snmp_basic/steps/02_snmp_update.j2 | 144 ++ .../snmp_basic/steps/03_snmp_unconfig.j2 | 147 ++ .../templates/snmp_basic/steps/setup.j2 | 4 + .../templates/snmp_basic/steps/teardown.j2 | 147 ++ .../os10_snmp_role/tests/snmp_basic.yaml | 0 .../targets/os10_snmp_role/vars/main.yaml | 3 + .../os10_system_role/defaults/main.yaml | 2 + .../targets/os10_system_role/tasks | 1 + .../system_basic/steps/01_system_configure.j2 | 26 + .../system_basic/steps/02_system_update.j2 | 26 + .../system_basic/steps/03_system_unconfig.j2 | 26 + .../templates/system_basic/steps/teardown.j2 | 25 + .../os10_system_role/tests/system_basic.yaml | 0 .../targets/os10_system_role/vars/main.yaml | 2 + .../os10_uplink_role/defaults/main.yaml | 2 + .../targets/os10_uplink_role/tasks | 1 + .../uplink_basic/steps/01_uplink_configure.j2 | 32 + .../uplink_basic/steps/02_uplink_update.j2 | 30 + .../uplink_basic/steps/03_uplink_absent.j2 | 30 + .../templates/uplink_basic/steps/setup.j2 | 5 + .../templates/uplink_basic/steps/teardown.j2 | 38 + .../os10_uplink_role/tests/uplink_basic.yaml | 0 .../targets/os10_uplink_role/vars/main.yaml | 3 + .../os10_users_role/defaults/main.yaml | 2 + .../integration/targets/os10_users_role/tasks | 1 + .../os10_users_role/tasks_old/main.yaml | 15 + .../users_basic/steps/01_users_add.j2 | 9 + .../users_basic/steps/02_users_del.j2 | 5 + .../templates/users_basic/steps/teardown.j2 | 9 + .../os10_users_role/tests/users_basic.yaml | 0 .../targets/os10_users_role/vars/main.yaml | 2 + .../targets/os10_vlan_role/defaults/main.yaml | 3 + .../integration/targets/os10_vlan_role/tasks | 1 + .../vlan_basic/steps/01_vlan_configure.j2 | 17 + .../vlan_basic/steps/02_vlan_update.j2 | 19 + .../steps/03_vlan_member_port_range.j2 | 17 + .../vlan_basic/steps/04_vlan_absent.j2 | 20 + .../templates/vlan_basic/steps/setup.j2 | 3 + .../templates/vlan_basic/steps/teardown.j2 | 25 + .../os10_vlan_role/tests/vlan_basic.yaml | 0 .../targets/os10_vlan_role/vars/main.yaml | 6 + .../targets/os10_vlt_role/defaults/main.yaml | 3 + tests/integration/targets/os10_vlt_role/tasks | 1 + .../vlt_basic/steps/01_vlt_configure.j2 | 15 + .../vlt_basic/steps/02_vlt_update.j2 | 14 + .../vlt_basic/steps/03_vlt_absent.j2 | 12 + .../templates/vlt_basic/steps/setup.j2 | 7 + .../templates/vlt_basic/steps/teardown.j2 | 23 + .../os10_vlt_role/tests/vlt_basic.yaml | 0 .../targets/os10_vlt_role/vars/main.yaml | 7 + .../targets/os10_vrrp_role/defaults/main.yaml | 2 + .../integration/targets/os10_vrrp_role/tasks | 1 + .../vrrp_basic/steps/01_vrrp_configure.j2 | 43 + .../vrrp_basic/steps/02_vrrp_update.j2 | 41 + .../steps/03_vrrp_options_absent.j2 | 41 + .../vrrp_basic/steps/04_vrrp_absent.j2 | 41 + .../templates/vrrp_basic/steps/setup.j2 | 3 + .../templates/vrrp_basic/steps/teardown.j2 | 47 + .../os10_vrrp_role/tests/vrrp_basic.yaml | 0 .../targets/os10_vrrp_role/vars/main.yaml | 3 + .../targets/os10_xstp_role/defaults/main.yaml | 2 + .../integration/targets/os10_xstp_role/tasks | 1 + .../steps/01_xstp_rstp_configure.j2 | 14 + .../xstp_basic/steps/02_xstp_rstp_defaults.j2 | 12 + .../steps/03_xstp_pvst_configure.j2 | 16 + .../xstp_basic/steps/04_xstp_pvst_defaults.j2 | 16 + .../steps/05_xstp_mstp_configure.j2 | 24 + .../xstp_basic/steps/06_xstp_mstp_defaults.j2 | 24 + .../steps/07_xstp_interface_configure.j2 | 25 + .../steps/08_xstp_interface_defaults.j2 | 25 + .../templates/xstp_basic/steps/setup.j2 | 4 + .../templates/xstp_basic/steps/teardown.j2 | 60 + .../os10_xstp_role/tests/xstp_basic.yaml | 0 .../targets/os10_xstp_role/vars/main.yaml | 3 + .../targets/role_test/tasks/main.yaml | 3 + .../role_test/tasks/prepare_test_facts.yaml | 14 + .../tasks/testcase/include_os10_role.yaml | 20 + .../tasks/testcase/run_test_case.yaml | 62 + .../tasks/testcase/run_test_step.yaml | 26 + .../targets/role_test/tasks/tests.yaml | 14 + tests/sanity/ignore-2.10.txt | 7 + 293 files changed, 8463 insertions(+), 825 deletions(-) create mode 100644 docs/dellemc.os10.os10_command_module.rst create mode 100644 docs/dellemc.os10.os10_config_module.rst create mode 100644 docs/dellemc.os10.os10_facts_module.rst create mode 100644 roles/os10_ntp/templates/os10_ntp_vrf.j2 create mode 100644 roles/os10_template/tasks/show_spanning_tree_compatibility_mode.yaml create mode 100644 roles/os10_template/tasks/show_vlt_err_disabled_ports.yaml create mode 100644 roles/os10_template/templates/os10_show_spanning_tree_compatibility_mode.template create mode 100644 roles/os10_template/templates/os10_show_vlt_err_disabled_ports.template create mode 100644 tests/integration/target-prefixes.network rename tests/integration/targets/{os10_command/os10_command => os10_aaa_role}/defaults/main.yaml (100%) create mode 120000 tests/integration/targets/os10_aaa_role/tasks create mode 100644 tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/01_aaa_configure.j2 create mode 100644 tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/02_aaa_update.j2 create mode 100644 tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/03_aaa_empty_string.j2 create mode 100644 tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/04_aaa_absent.j2 create mode 100644 tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/05_aaa_stateless.j2 create mode 100644 tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_aaa_role/tests/aaa_basic.yaml create mode 100644 tests/integration/targets/os10_aaa_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_acl_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_acl_role/tasks create mode 100644 tests/integration/targets/os10_acl_role/templates/acl_basic/steps/01_acl_config.j2 create mode 100644 tests/integration/targets/os10_acl_role/templates/acl_basic/steps/02_acl_stage.j2 create mode 100644 tests/integration/targets/os10_acl_role/templates/acl_basic/steps/03_acl_update.j2 create mode 100644 tests/integration/targets/os10_acl_role/templates/acl_basic/steps/04_acl_suboptions_absent.j2 create mode 100644 tests/integration/targets/os10_acl_role/templates/acl_basic/steps/05_acl_suboptions_stateless.j2 create mode 100644 tests/integration/targets/os10_acl_role/templates/acl_basic/steps/06_acl_absent.j2 create mode 100644 tests/integration/targets/os10_acl_role/templates/acl_basic/steps/07_acl_stateless.j2 create mode 100644 tests/integration/targets/os10_acl_role/templates/acl_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_acl_role/tests/acl_basic.yaml create mode 100644 tests/integration/targets/os10_acl_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_bgp_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_bgp_role/tasks create mode 100644 tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/01_bgp_default_vrf_config.j2 create mode 100644 tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/02_bgp_default_vrf_unconfig.j2 create mode 100644 tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/03_bgp_non_default_vrf_config.j2 create mode 100644 tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/04_bgp_non_default_vrf_unconfig.j2 create mode 100644 tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/05_bgp_default_non_default_vrf_config.j2 create mode 100644 tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/06_bgp_default_non_default_vrf_unconfig.j2 create mode 100644 tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/setup.j2 create mode 100644 tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_bgp_role/tests/bgp_vrf.yaml create mode 100644 tests/integration/targets/os10_bgp_role/vars/main.yaml rename tests/integration/targets/{os10_config/os10_config => os10_command}/defaults/main.yaml (100%) rename tests/integration/targets/os10_command/{os10_command => }/tasks/cli.yaml (100%) rename tests/integration/targets/os10_command/{os10_command => }/tasks/main.yaml (100%) rename tests/integration/targets/os10_command/{os10_command => }/tests/cli/bad_operator.yaml (93%) rename tests/integration/targets/os10_command/{os10_command => }/tests/cli/contains.yaml (84%) rename tests/integration/targets/os10_command/{os10_command => }/tests/cli/invalid.yaml (70%) rename tests/integration/targets/os10_command/{os10_command => }/tests/cli/output.yaml (91%) rename tests/integration/targets/os10_command/{os10_command => }/tests/cli/timeout.yaml (92%) rename tests/integration/targets/{os10_facts/os10_facts => os10_config}/defaults/main.yaml (100%) delete mode 100644 tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_block.yaml delete mode 100644 tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_exact.yaml delete mode 100644 tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_strict.yaml rename tests/integration/targets/os10_config/{os10_config => }/tasks/cli.yaml (100%) rename tests/integration/targets/os10_config/{os10_config => }/tasks/main.yaml (100%) rename tests/integration/targets/os10_config/{os10_config => }/tests/cli/sublevel.yaml (88%) create mode 100644 tests/integration/targets/os10_config/tests/cli/sublevel_block.yaml create mode 100644 tests/integration/targets/os10_config/tests/cli/sublevel_exact.yaml create mode 100644 tests/integration/targets/os10_config/tests/cli/sublevel_strict.yaml rename tests/integration/targets/os10_config/{os10_config => }/tests/cli/toplevel.yaml (86%) rename tests/integration/targets/os10_config/{os10_config => }/tests/cli/toplevel_after.yaml (89%) rename tests/integration/targets/os10_config/{os10_config => }/tests/cli/toplevel_before.yaml (89%) rename tests/integration/targets/os10_config/{os10_config => }/tests/cli/toplevel_nonidempotent.yaml (87%) create mode 100644 tests/integration/targets/os10_ecmp_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_ecmp_role/tasks create mode 100644 tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/01_ecmp_configure.j2 create mode 100644 tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/02_ecmp_update.j2 create mode 100644 tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/03_ecmp_unconfig.j2 create mode 100644 tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_ecmp_role/tests/ecmp_basic.yaml create mode 100644 tests/integration/targets/os10_ecmp_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_facts/defaults/main.yaml rename tests/integration/targets/os10_facts/{os10_facts => }/tasks/cli.yaml (100%) rename tests/integration/targets/os10_facts/{os10_facts => }/tasks/main.yaml (100%) rename tests/integration/targets/os10_facts/{os10_facts => }/tests/cli/facts.yaml (93%) create mode 100644 tests/integration/targets/os10_flow_monitor_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_flow_monitor_role/tasks create mode 100644 tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/01_flow_monitor_configure.j2 create mode 100644 tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/02_flow_monitory_update.j2 create mode 100644 tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/03_flow_monitor_options_default.j2 create mode 100644 tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/setup.j2 create mode 100644 tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_flow_monitor_role/tests/flow_monitor_basic.yaml create mode 100644 tests/integration/targets/os10_flow_monitor_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_interface_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_interface_role/tasks create mode 100644 tests/integration/targets/os10_interface_role/templates/interface_basic/steps/01_interface_config.j2 create mode 100644 tests/integration/targets/os10_interface_role/templates/interface_basic/steps/02_interface_dynamic_ip.j2 create mode 100644 tests/integration/targets/os10_interface_role/templates/interface_basic/steps/03_interface_static_ip.j2 create mode 100644 tests/integration/targets/os10_interface_role/templates/interface_basic/steps/04_interface_flowcontrol.j2 create mode 100644 tests/integration/targets/os10_interface_role/templates/interface_basic/steps/05_interface_switchport.j2 create mode 100644 tests/integration/targets/os10_interface_role/templates/interface_basic/steps/06_interface_vlan.j2 create mode 100644 tests/integration/targets/os10_interface_role/templates/interface_basic/steps/07_interface_range.j2 create mode 100644 tests/integration/targets/os10_interface_role/templates/interface_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_interface_role/tests/interface_basic.yaml create mode 100644 tests/integration/targets/os10_interface_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_lag_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_lag_role/tasks create mode 100644 tests/integration/targets/os10_lag_role/templates/lag_basic/steps/01_lag_configure.j2 create mode 100644 tests/integration/targets/os10_lag_role/templates/lag_basic/steps/02_lag_update.j2 create mode 100644 tests/integration/targets/os10_lag_role/templates/lag_basic/steps/03_lag_options_reset.j2 create mode 100644 tests/integration/targets/os10_lag_role/templates/lag_basic/steps/04_lag_absent.j2 create mode 100644 tests/integration/targets/os10_lag_role/templates/lag_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_lag_role/tests/lag_basic.yaml create mode 100644 tests/integration/targets/os10_lag_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_lldp_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_lldp_role/tasks create mode 100644 tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/01_lldp_configure.j2 create mode 100644 tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/02_lldp_update.j2 create mode 100644 tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/03_lldp_options_absent.j2 create mode 100644 tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_lldp_role/tests/lldp_basic.yaml create mode 100644 tests/integration/targets/os10_lldp_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_logging_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_logging_role/tasks create mode 100644 tests/integration/targets/os10_logging_role/templates/logging_basic/steps/01_logging_enable.j2 create mode 100644 tests/integration/targets/os10_logging_role/templates/logging_basic/steps/02_logging_update.j2 create mode 100644 tests/integration/targets/os10_logging_role/templates/logging_basic/steps/03_logging_disable.j2 create mode 100644 tests/integration/targets/os10_logging_role/templates/logging_basic/steps/04_logging_server_add.j2 create mode 100644 tests/integration/targets/os10_logging_role/templates/logging_basic/steps/05_logging_server_del.j2 create mode 100644 tests/integration/targets/os10_logging_role/templates/logging_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_logging_role/tests/logging_basic.yaml create mode 100644 tests/integration/targets/os10_logging_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_ntp_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_ntp_role/tasks create mode 100644 tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/01_ntp_configure.j2 create mode 100644 tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/02_ntp_update.j2 create mode 100644 tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/03_ntp_suboptions_absent.j2 create mode 100644 tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/04_ntp_suboptions_stateless.j2 create mode 100644 tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/05_ntp_empty_string.j2 create mode 100644 tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/setup.j2 create mode 100644 tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_ntp_role/tests/ntp_basic.yaml create mode 100644 tests/integration/targets/os10_ntp_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_prefix_list_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_prefix_list_role/tasks create mode 100644 tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/01_prefix_list_config.j2 create mode 100644 tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/02_prefix_list_update.j2 create mode 100644 tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/03_prefix_list_entry_absent.j2 create mode 100644 tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/04_prefix_list_absent.j2 create mode 100644 tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_prefix_list_role/tests/prefix_list_basic.yaml create mode 100644 tests/integration/targets/os10_prefix_list_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_qos_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_qos_role/tasks create mode 100644 tests/integration/targets/os10_qos_role/templates/qos_basic/steps/01_qos_config.j2 create mode 100644 tests/integration/targets/os10_qos_role/templates/qos_basic/steps/02_qos_update.j2 create mode 100644 tests/integration/targets/os10_qos_role/templates/qos_basic/steps/03_qos_unconfig.j2 create mode 100644 tests/integration/targets/os10_qos_role/templates/qos_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_qos_role/tests/qos_basic.yaml create mode 100644 tests/integration/targets/os10_qos_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_route_map_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_route_map_role/tasks create mode 100644 tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/01_route_map_configure.j2 create mode 100644 tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/02_route_map_update.j2 create mode 100644 tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/03_route_map_options_unconfig.j2 create mode 100644 tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/04_route_map_unconfig.j2 create mode 100644 tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_route_map_role/tests/route_map_basic.yaml create mode 100644 tests/integration/targets/os10_route_map_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_snmp_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_snmp_role/tasks create mode 100644 tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/01_snmp_configure.j2 create mode 100644 tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/02_snmp_update.j2 create mode 100644 tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/03_snmp_unconfig.j2 create mode 100644 tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/setup.j2 create mode 100644 tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_snmp_role/tests/snmp_basic.yaml create mode 100644 tests/integration/targets/os10_snmp_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_system_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_system_role/tasks create mode 100644 tests/integration/targets/os10_system_role/templates/system_basic/steps/01_system_configure.j2 create mode 100644 tests/integration/targets/os10_system_role/templates/system_basic/steps/02_system_update.j2 create mode 100644 tests/integration/targets/os10_system_role/templates/system_basic/steps/03_system_unconfig.j2 create mode 100644 tests/integration/targets/os10_system_role/templates/system_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_system_role/tests/system_basic.yaml create mode 100644 tests/integration/targets/os10_system_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_uplink_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_uplink_role/tasks create mode 100644 tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/01_uplink_configure.j2 create mode 100644 tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/02_uplink_update.j2 create mode 100644 tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/03_uplink_absent.j2 create mode 100644 tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/setup.j2 create mode 100644 tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_uplink_role/tests/uplink_basic.yaml create mode 100644 tests/integration/targets/os10_uplink_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_users_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_users_role/tasks create mode 100644 tests/integration/targets/os10_users_role/tasks_old/main.yaml create mode 100644 tests/integration/targets/os10_users_role/templates/users_basic/steps/01_users_add.j2 create mode 100644 tests/integration/targets/os10_users_role/templates/users_basic/steps/02_users_del.j2 create mode 100644 tests/integration/targets/os10_users_role/templates/users_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_users_role/tests/users_basic.yaml create mode 100644 tests/integration/targets/os10_users_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_vlan_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_vlan_role/tasks create mode 100644 tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/01_vlan_configure.j2 create mode 100644 tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/02_vlan_update.j2 create mode 100644 tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/03_vlan_member_port_range.j2 create mode 100644 tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/04_vlan_absent.j2 create mode 100644 tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/setup.j2 create mode 100644 tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_vlan_role/tests/vlan_basic.yaml create mode 100644 tests/integration/targets/os10_vlan_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_vlt_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_vlt_role/tasks create mode 100644 tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/01_vlt_configure.j2 create mode 100644 tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/02_vlt_update.j2 create mode 100644 tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/03_vlt_absent.j2 create mode 100644 tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/setup.j2 create mode 100644 tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_vlt_role/tests/vlt_basic.yaml create mode 100644 tests/integration/targets/os10_vlt_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_vrrp_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_vrrp_role/tasks create mode 100644 tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/01_vrrp_configure.j2 create mode 100644 tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/02_vrrp_update.j2 create mode 100644 tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/03_vrrp_options_absent.j2 create mode 100644 tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/04_vrrp_absent.j2 create mode 100644 tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/setup.j2 create mode 100644 tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_vrrp_role/tests/vrrp_basic.yaml create mode 100644 tests/integration/targets/os10_vrrp_role/vars/main.yaml create mode 100644 tests/integration/targets/os10_xstp_role/defaults/main.yaml create mode 120000 tests/integration/targets/os10_xstp_role/tasks create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/01_xstp_rstp_configure.j2 create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/02_xstp_rstp_defaults.j2 create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/03_xstp_pvst_configure.j2 create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/04_xstp_pvst_defaults.j2 create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/05_xstp_mstp_configure.j2 create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/06_xstp_mstp_defaults.j2 create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/07_xstp_interface_configure.j2 create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/08_xstp_interface_defaults.j2 create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/setup.j2 create mode 100644 tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/teardown.j2 create mode 100644 tests/integration/targets/os10_xstp_role/tests/xstp_basic.yaml create mode 100644 tests/integration/targets/os10_xstp_role/vars/main.yaml create mode 100644 tests/integration/targets/role_test/tasks/main.yaml create mode 100644 tests/integration/targets/role_test/tasks/prepare_test_facts.yaml create mode 100644 tests/integration/targets/role_test/tasks/testcase/include_os10_role.yaml create mode 100644 tests/integration/targets/role_test/tasks/testcase/run_test_case.yaml create mode 100644 tests/integration/targets/role_test/tasks/testcase/run_test_step.yaml create mode 100644 tests/integration/targets/role_test/tasks/tests.yaml diff --git a/README.md b/README.md index 9a7d109..2f38dd7 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ This collection includes Ansible modules, plugins and roles needed to provision ### Collection core modules -- **os10_command.py** — Run commands on devices running OS10 - -- **os10_config.py** — Manage configuration on devices running OS10 - -- **os10_facts.py** — Collect facts from devices running OS10 +Name | Description +--- | --- +[os10_command](docs/dellemc.os10.os10_command_module.rst)| Run commands on devices running OS10 +[os10_config](docs/dellemc.os10.os10_config_module.rst)| Manage configuration on devices running OS10 +[os10_facts](docs/dellemc.os10.os10_facts_module.rst)| Collect facts from devices running OS10 ### Collection roles These roles facilitate the provisioning and administration of devices running SmartFabric OS10. There are over 30 roles available that provide a comprehensive coverage of most OS10 resources, including *os10_interface*, *os10_acl*, *os10_bgp*, and *os10_vxlan*. The documentation for each role is at [OS10 roles](https://github.com/ansible-collections/dellemc.os10/blob/master/docs/roles.rst). diff --git a/changelogs/CHANGELOG.rst b/changelogs/CHANGELOG.rst index 0b805ea..d5a4cf4 100644 --- a/changelogs/CHANGELOG.rst +++ b/changelogs/CHANGELOG.rst @@ -5,6 +5,37 @@ Ansible Network Collection for Dell EMC SmartFabric OS10 Release Notes .. contents:: Topics +v1.1.0 +====== + +Major Changes +------------- + +- os10_bgp - Enhanced router bgp keyword support for non-default vrf which are supported for default vrf and additional keyword to support both default and non-default vrf +- os10_snmp role - Added support for snmp V3 features in community, group, host, engineID + +Minor Changes +------------- + +- Enhanced os10_bgp role to support internal BGP redistribution under address-family for V4 and V6 +- Enhanced os10_bgp role to support maximum-prefix configuration under BGP peer and peer-group. +- os10_ntp role - Added support for vrf and sha1 and sha2-256 authentication-key types +- os10_snmp role - Added support for source-interface and vrf +- os10_template - add template for show spanning tree compatibility mode +- os10_template - add template for show vlt error disabled ports +- os10_uplink role - Added support for downstream disable-links and auto-recover + +Breaking Changes / Porting Guide +-------------------------------- + +- os10_bgp - Changed "subnet" key as list format instead of dictionary format under "listen" key to support multiple neighbor prefix for listen command +- os10_bgp - Changed "vrf" key as list format instead of dictionary format to supprot multiple VRF in router BGP and changed the "vrf" key name to "vrfs" + +Bugfixes +-------- + +- Fixed issue in using interface range in os10_vlan members. (https://github.com/ansible-collections/dellemc.os10/issues/53) + v1.0.2 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index be64746..432c6d6 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -85,3 +85,33 @@ releases: - 1.0.2.yaml - 46-vlan-idempotency-desc-and-members.yaml release_date: '2020-10-28' + 1.1.0: + changes: + breaking_changes: + - os10_bgp - Changed "subnet" key as list format instead of dictionary format + under "listen" key to support multiple neighbor prefix for listen command + - os10_bgp - Changed "vrf" key as list format instead of dictionary format to + supprot multiple VRF in router BGP and changed the "vrf" key name to "vrfs" + bugfixes: + - Fixed issue in using interface range in os10_vlan members. (https://github.com/ansible-collections/dellemc.os10/issues/53) + major_changes: + - os10_bgp - Enhanced router bgp keyword support for non-default vrf which are + supported for default vrf and additional keyword to support both default and + non-default vrf + - os10_snmp role - Added support for snmp V3 features in community, group, host, + engineID + minor_changes: + - Enhanced os10_bgp role to support internal BGP redistribution under address-family + for V4 and V6 + - Enhanced os10_bgp role to support maximum-prefix configuration under BGP peer + and peer-group. + - os10_ntp role - Added support for vrf and sha1 and sha2-256 authentication-key + types + - os10_snmp role - Added support for source-interface and vrf + - os10_template - add template for show spanning tree compatibility mode + - os10_template - add template for show vlt error disabled ports + - os10_uplink role - Added support for downstream disable-links and auto-recover + fragments: + - 53-vlan-member-port-range.yaml + - R9.yaml + release_date: '2020-12-02' diff --git a/docs/dellemc.os10.os10_command_module.rst b/docs/dellemc.os10.os10_command_module.rst new file mode 100644 index 0000000..4bec5b2 --- /dev/null +++ b/docs/dellemc.os10.os10_command_module.rst @@ -0,0 +1,446 @@ +.. Document meta + + +.. Anchors + +.. _ansible_collections.dellemc.os10.os10_command_module: + +.. Anchors: short name for ansible.builtin + +.. Anchors: aliases + + + +.. Title + +dellemc.os10.os10_command -- Run commands on devices running Dell EMC SmartFabric OS10 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. Collection note + +.. note:: + This plugin is part of the `dellemc.os10 collection `_. + + To install it use: :code:`ansible-galaxy collection install dellemc.os10`. + + To use it in a playbook, specify: :code:`dellemc.os10.os10_command`. + +.. version_added + + +.. contents:: + :local: + :depth: 1 + +.. Deprecated + + +Synopsis +-------- + +.. Description + +- Sends arbitrary commands to a OS10 device and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met. +- This module does not support running commands in configuration mode. Please use `dellemc.os10.os10_config `_ to configure OS10 devices. + + +.. Aliases + + +.. Requirements + + +.. Options + +Parameters +---------- + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterChoices/DefaultsComments
+
+ commands + +
+ list + / elements=string / required
+
+ +
List of commands to send to the remote OS10 device over the configured provider. The resulting output from the command is returned. If the wait_for argument is provided, the module is not returned until the condition is satisfied or the number of retries has expired.
+
+
+ interval + +
+ integer +
+
+ Default:
1
+
+
Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again.
+
+
+ match + +
+ string +
+
+
    Choices: +
  • all ←
  • +
  • any
  • +
+
+
The match argument is used in conjunction with the wait_for argument to specify the match policy. Valid values are all or any. If the value is set to all then all conditionals in the wait_for must be satisfied. If the value is set to any then only one of the values must be satisfied.
+
+
+ provider + +
+ dictionary +
+
+ +
A dict object containing connection details.
+
+
+ auth_pass + +
+ string +
+
+ +
Specifies the password to use if required to enter privileged mode on the remote device. If authorize is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTH_PASS will be used instead.
+
+
+ authorize + +
+ boolean +
+
+
    Choices: +
  • no ←
  • +
  • yes
  • +
+
+
Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTHORIZE will be used instead.
+
+
+ host + +
+ string +
+
+ +
Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport.
+
+
+ password + +
+ string +
+
+ +
Password to authenticate the SSH session to the remote device. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_PASSWORD will be used instead.
+
+
+ port + +
+ integer +
+
+ +
Specifies the port to use when building the connection to the remote device.
+
+
+ ssh_keyfile + +
+ path +
+
+ +
Path to an ssh key used to authenticate the SSH session to the remote device. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_SSH_KEYFILE will be used instead.
+
+
+ timeout + +
+ integer +
+
+ +
Specifies idle timeout (in seconds) for the connection. Useful if the console freezes before continuing. For example when saving configurations.
+
+
+ username + +
+ string +
+
+ +
User to authenticate the SSH session to the remote device. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_USERNAME will be used instead.
+
+
+ retries + +
+ integer +
+
+ Default:
10
+
+
Specifies the number of retries a command should be tried before it is considered failed. The command is run on the target device every retry and evaluated against the wait_for conditions.
+
+
+ wait_for + +
+ list + / elements=string
+
+ +
List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples.
+
+
+ +.. Notes + +Notes +----- + +.. note:: + - For more information on using Ansible to manage Dell EMC Network devices see https://www.ansible.com/ansible-dell-networking. + +.. Seealso + + +.. Examples + +Examples +-------- + +.. code-block:: yaml+jinja + + + tasks: + - name: run show version on remote devices + os10_command: + commands: show version + + - name: run show version and check to see if output contains OS10 + os10_command: + commands: show version + wait_for: result[0] contains OS10 + + - name: run multiple commands on remote nodes + os10_command: + commands: + - show version + - show interface + + - name: run multiple commands and evaluate the output + os10_command: + commands: + - show version + - show interface + wait_for: + - result[0] contains OS10 + - result[1] contains Ethernet + + + + +.. Facts + + +.. Return values + +Return Values +------------- +Common return values are documented `here `_, the following are the fields unique to this module: + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyReturnedDescription
+
+ failed_conditions + +
+ list + / elements=string
+
failed +
The list of conditionals that have failed
+
+
Sample:
+
['...', '...']
+
+
+ stdout + +
+ list + / elements=string
+
always apart from low level errors (such as action plugin) +
The set of responses from the commands
+
+
Sample:
+
['...', '...']
+
+
+ stdout_lines + +
+ list + / elements=string
+
always apart from low level errors (such as action plugin) +
The value of stdout split into a list
+
+
Sample:
+
[['...', '...'], ['...'], ['...']]
+
+
+ warnings + +
+ list + / elements=string
+
always +
The list of warnings (if any) generated by module based on arguments
+
+
Sample:
+
['...', '...']
+
+

+ +.. Status (Presently only deprecated) + + +.. Authors + +Authors +~~~~~~~ + +- Senthil Kumar Ganesan (@skg-net) + + + +.. Parsing errors + diff --git a/docs/dellemc.os10.os10_config_module.rst b/docs/dellemc.os10.os10_config_module.rst new file mode 100644 index 0000000..7374780 --- /dev/null +++ b/docs/dellemc.os10.os10_config_module.rst @@ -0,0 +1,606 @@ +.. Document meta + + +.. Anchors + +.. _ansible_collections.dellemc.os10.os10_config_module: + +.. Anchors: short name for ansible.builtin + +.. Anchors: aliases + + + +.. Title + +dellemc.os10.os10_config -- Manage Dell EMC SmartFabric OS10 configuration sections ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. Collection note + +.. note:: + This plugin is part of the `dellemc.os10 collection `_. + + To install it use: :code:`ansible-galaxy collection install dellemc.os10`. + + To use it in a playbook, specify: :code:`dellemc.os10.os10_config`. + +.. version_added + + +.. contents:: + :local: + :depth: 1 + +.. Deprecated + + +Synopsis +-------- + +.. Description + +- OS10 configurations use a simple block indent file syntax for segmenting configuration into sections. This module provides an implementation for working with OS10 configuration sections in a deterministic way. + + +.. Aliases + + +.. Requirements + + +.. Options + +Parameters +---------- + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterChoices/DefaultsComments
+
+ after + +
+ list + / elements=string
+
+ +
The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with before this allows the playbook designer to append a set of commands to be executed after the command set.
+
+
+ backup + +
+ boolean +
+
+
    Choices: +
  • no ←
  • +
  • yes
  • +
+
+
This argument will cause the module to create a full backup of the current running-config from the remote device before any changes are made. If the backup_options value is not given, the backup file is written to the backup folder in the playbook root directory. If the directory does not exist, it is created.
+
+
+ backup_options + +
+ dictionary +
+
+ +
This is a dict object containing configurable options related to backup file path. The value of this option is read only when backup is set to yes, if backup is set to no this option will be silently ignored.
+
+
+ dir_path + +
+ path +
+
+ +
This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of filename or default filename as described in filename options description. If the path value is not given in that case a backup directory will be created in the current working directory and backup configuration will be copied in filename within backup directory.
+
+
+ filename + +
+ string +
+
+ +
The filename to be used to store the backup configuration. If the the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>_config.<current-date>@<current-time>
+
+
+ before + +
+ list + / elements=string
+
+ +
The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system.
+
+
+ config + +
+ string +
+
+ +
The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The config argument allows the implementer to pass in the configuration to use as the base config for comparison.
+
+
+ lines + +
+ list + / elements=string
+
+ +
The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser. This argument is mutually exclusive with src.
+

aliases: commands
+
+
+ match + +
+ string +
+
+
    Choices: +
  • line ←
  • +
  • strict
  • +
  • exact
  • +
  • none
  • +
+
+
Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to line, commands are matched line by line. If match is set to strict, command lines are matched with respect to position. If match is set to exact, command lines must be an equal match. Finally, if match is set to none, the module will not attempt to compare the source configuration with the running configuration on the remote device.
+
+
+ parents + +
+ list + / elements=string
+
+ +
The ordered set of parents that uniquely identify the section or hierarchy the commands should be checked against. If the parents argument is omitted, the commands are checked against the set of top level or global commands.
+
+
+ provider + +
+ dictionary +
+
+ +
A dict object containing connection details.
+
+
+ auth_pass + +
+ string +
+
+ +
Specifies the password to use if required to enter privileged mode on the remote device. If authorize is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTH_PASS will be used instead.
+
+
+ authorize + +
+ boolean +
+
+
    Choices: +
  • no ←
  • +
  • yes
  • +
+
+
Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTHORIZE will be used instead.
+
+
+ host + +
+ string +
+
+ +
Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport.
+
+
+ password + +
+ string +
+
+ +
Password to authenticate the SSH session to the remote device. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_PASSWORD will be used instead.
+
+
+ port + +
+ integer +
+
+ +
Specifies the port to use when building the connection to the remote device.
+
+
+ ssh_keyfile + +
+ path +
+
+ +
Path to an ssh key used to authenticate the SSH session to the remote device. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_SSH_KEYFILE will be used instead.
+
+
+ timeout + +
+ integer +
+
+ +
Specifies idle timeout (in seconds) for the connection. Useful if the console freezes before continuing. For example when saving configurations.
+
+
+ username + +
+ string +
+
+ +
User to authenticate the SSH session to the remote device. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_USERNAME will be used instead.
+
+
+ replace + +
+ string +
+
+
    Choices: +
  • line ←
  • +
  • block
  • +
+
+
Instructs the module on the way to perform the configuration on the device. If the replace argument is set to line then the modified lines are pushed to the device in configuration mode. If the replace argument is set to block then the entire command block is pushed to the device in configuration mode if any line is not correct.
+
+
+ save + +
+ boolean +
+
+
    Choices: +
  • no ←
  • +
  • yes
  • +
+
+
The save argument instructs the module to save the running- config to the startup-config at the conclusion of the module running. If check mode is specified, this argument is ignored.
+
+
+ src + +
+ path +
+
+ +
Specifies the source path to the file that contains the configuration or configuration template to load. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. This argument is mutually exclusive with lines.
+
+
+ update + +
+ string +
+
+
    Choices: +
  • merge ←
  • +
  • check
  • +
+
+
The update argument controls how the configuration statements are processed on the remote device. Valid choices for the update argument are merge and check. When you set this argument to merge, the configuration changes merge with the current device running configuration. When you set this argument to check the configuration updates are determined but not actually configured on the remote device.
+
+
+ +.. Notes + +Notes +----- + +.. note:: + - For more information on using Ansible to manage Dell EMC Network devices see https://www.ansible.com/ansible-dell-networking. + +.. Seealso + + +.. Examples + +Examples +-------- + +.. code-block:: yaml+jinja + + + - os10_config: + lines: ['hostname {{ inventory_hostname }}'] + + - os10_config: + lines: + - 10 permit ip host 1.1.1.1 any log + - 20 permit ip host 2.2.2.2 any log + - 30 permit ip host 3.3.3.3 any log + - 40 permit ip host 4.4.4.4 any log + - 50 permit ip host 5.5.5.5 any log + parents: ['ip access-list test'] + before: ['no ip access-list test'] + match: exact + + - os10_config: + lines: + - 10 permit ip host 1.1.1.1 any log + - 20 permit ip host 2.2.2.2 any log + - 30 permit ip host 3.3.3.3 any log + - 40 permit ip host 4.4.4.4 any log + parents: ['ip access-list test'] + before: ['no ip access-list test'] + replace: block + + - os10_config: + lines: ['hostname {{ inventory_hostname }}'] + backup: yes + backup_options: + filename: backup.cfg + dir_path: /home/user + + + + +.. Facts + + +.. Return values + +Return Values +------------- +Common return values are documented `here `_, the following are the fields unique to this module: + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyReturnedDescription
+
+ backup_path + +
+ string +
+
when backup is yes +
The full path to the backup file
+
+
Sample:
+
/playbooks/ansible/backup/os10_config.2016-07-16@22:28:34
+
+
+ commands + +
+ list + / elements=string
+
always +
The set of commands that will be pushed to the remote device
+
+
Sample:
+
['hostname foo', 'router bgp 1', 'router-id 1.1.1.1']
+
+
+ saved + +
+ boolean +
+
When not check_mode. +
Returns whether the configuration is saved to the startup configuration or not.
+
+
Sample:
+
True
+
+
+ updates + +
+ list + / elements=string
+
always +
The set of commands that will be pushed to the remote device.
+
+
Sample:
+
['hostname foo', 'router bgp 1', 'router-id 1.1.1.1']
+
+

+ +.. Status (Presently only deprecated) + + +.. Authors + +Authors +~~~~~~~ + +- Senthil Kumar Ganesan (@skg-net) + + + +.. Parsing errors + diff --git a/docs/dellemc.os10.os10_facts_module.rst b/docs/dellemc.os10.os10_facts_module.rst new file mode 100644 index 0000000..658a3d9 --- /dev/null +++ b/docs/dellemc.os10.os10_facts_module.rst @@ -0,0 +1,511 @@ +.. Document meta + + +.. Anchors + +.. _ansible_collections.dellemc.os10.os10_facts_module: + +.. Anchors: short name for ansible.builtin + +.. Anchors: aliases + + + +.. Title + +dellemc.os10.os10_facts -- Collect facts from devices running Dell EMC SmartFabric OS10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. Collection note + +.. note:: + This plugin is part of the `dellemc.os10 collection `_. + + To install it use: :code:`ansible-galaxy collection install dellemc.os10`. + + To use it in a playbook, specify: :code:`dellemc.os10.os10_facts`. + +.. version_added + + +.. contents:: + :local: + :depth: 1 + +.. Deprecated + + +Synopsis +-------- + +.. Description + +- Collects a base set of device facts from a remote device that is running OS10. This module prepends all of the base network fact keys with ``ansible_net_``. The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts. + + +.. Aliases + + +.. Requirements + + +.. Options + +Parameters +---------- + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterChoices/DefaultsComments
+
+ gather_subset + +
+ list + / elements=string
+
+ Default:
["!config"]
+
+
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.
+
+
+ provider + +
+ dictionary +
+
+ +
A dict object containing connection details.
+
+
+ auth_pass + +
+ string +
+
+ +
Specifies the password to use if required to enter privileged mode on the remote device. If authorize is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTH_PASS will be used instead.
+
+
+ authorize + +
+ boolean +
+
+
    Choices: +
  • no ←
  • +
  • yes
  • +
+
+
Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTHORIZE will be used instead.
+
+
+ host + +
+ string +
+
+ +
Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport.
+
+
+ password + +
+ string +
+
+ +
Password to authenticate the SSH session to the remote device. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_PASSWORD will be used instead.
+
+
+ port + +
+ integer +
+
+ +
Specifies the port to use when building the connection to the remote device.
+
+
+ ssh_keyfile + +
+ path +
+
+ +
Path to an ssh key used to authenticate the SSH session to the remote device. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_SSH_KEYFILE will be used instead.
+
+
+ timeout + +
+ integer +
+
+ +
Specifies idle timeout (in seconds) for the connection. Useful if the console freezes before continuing. For example when saving configurations.
+
+
+ username + +
+ string +
+
+ +
User to authenticate the SSH session to the remote device. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_USERNAME will be used instead.
+
+
+ +.. Notes + +Notes +----- + +.. note:: + - For more information on using Ansible to manage Dell EMC Network devices see https://www.ansible.com/ansible-dell-networking. + +.. Seealso + + +.. Examples + +Examples +-------- + +.. code-block:: yaml+jinja + + + # Collect all facts from the device + - os10_facts: + gather_subset: all + + # Collect only the config and default facts + - os10_facts: + gather_subset: + - config + + # Do not collect hardware facts + - os10_facts: + gather_subset: + - "!hardware" + + + + +.. Facts + + +.. Return values + +Return Values +------------- +Common return values are documented `here `_, the following are the fields unique to this module: + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyReturnedDescription
+
+ ansible_net_all_ipv4_addresses + +
+ list + / elements=string
+
when interfaces is configured +
All IPv4 addresses configured on the device
+
+
+
+ ansible_net_all_ipv6_addresses + +
+ list + / elements=string
+
when interfaces is configured +
All IPv6 addresses configured on the device
+
+
+
+ ansible_net_config + +
+ string +
+
when config is configured +
The current active config from the device
+
+
+
+ ansible_net_cpu_arch + +
+ string +
+
when hardware is configured +
CPU Architecture of the remote device.
+
+
+
+ ansible_net_gather_subset + +
+ list + / elements=string
+
always +
The list of fact subsets collected from the device
+
+
+
+ ansible_net_hostname + +
+ string +
+
always +
The configured hostname of the device
+
+
+
+ ansible_net_interfaces + +
+ dictionary +
+
when interfaces is configured +
A hash of all interfaces running on the system
+
+
+
+ ansible_net_memfree_mb + +
+ integer +
+
when hardware is configured +
The available free memory on the remote device in Mb
+
+
+
+ ansible_net_memtotal_mb + +
+ integer +
+
when hardware is configured +
The total memory on the remote device in Mb
+
+
+
+ ansible_net_model + +
+ string +
+
always +
The model name returned from the device.
+
+
+
+ ansible_net_name + +
+ string +
+
Always. +
The name of the OS that is running.
+
+
+
+ ansible_net_neighbors + +
+ dictionary +
+
when interfaces is configured +
The list of LLDP neighbors from the remote device
+
+
+
+ ansible_net_servicetag + +
+ string +
+
always +
The service tag number of the remote device.
+
+
+
+ ansible_net_version + +
+ string +
+
always +
The operating system version running on the remote device
+
+
+

+ +.. Status (Presently only deprecated) + + +.. Authors + +Authors +~~~~~~~ + +- Senthil Kumar Ganesan (@skg-net) + + + +.. Parsing errors + diff --git a/galaxy.yml b/galaxy.yml index 655b5f7..518031e 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -10,7 +10,7 @@ name: os10 namespace: dellemc readme: README.md tags: [dell, dellemc, os10, emc, networking] -version: 1.0.2 +version: 1.1.0 repository: https://github.com/ansible-collections/dellemc.os10 documentation: https://github.com/ansible-collections/dellemc.os10/tree/master/docs homepage: https://github.com/ansible-collections/dellemc.os10 diff --git a/plugins/modules/os10_facts.py b/plugins/modules/os10_facts.py index 5e55557..c124422 100644 --- a/plugins/modules/os10_facts.py +++ b/plugins/modules/os10_facts.py @@ -212,7 +212,7 @@ class Hardware(FactsBase): COMMANDS = [ 'show version | display-xml', - 'show processes node-id 1 | grep Mem:' + 'show processes node-id 1 | grep "Mem :"' ] def populate(self): @@ -228,7 +228,7 @@ def populate(self): match = self.parse_memory(data) if match: self.facts['memtotal_mb'] = int(match[0]) // 1024 - self.facts['memfree_mb'] = int(match[2]) // 1024 + self.facts['memfree_mb'] = int(match[1]) // 1024 def parse_cpu_arch(self, data): cpu_arch = data.find('./data/system-sw-state/sw-version/cpu-arch') diff --git a/roles/os10_aaa/README.md b/roles/os10_aaa/README.md index 2c397db..cabee7e 100644 --- a/roles/os10_aaa/README.md +++ b/roles/os10_aaa/README.md @@ -3,7 +3,7 @@ AAA role This role facilitates the configuration of authentication, authorization, and acccounting (AAA). It supports the configuration of RADIUS server, TACACS server, and AAA. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The AAA role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The AAA role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_acl/README.md b/roles/os10_acl/README.md index 069de9b..14a1fe2 100644 --- a/roles/os10_acl/README.md +++ b/roles/os10_acl/README.md @@ -3,7 +3,7 @@ ACL role This role facilitates the configuration of an access-control list (ACL). It supports the configuration of different types of ACLs (standard and extended) for both IPv4 and IPv6, and assigns the access-class to the line terminals. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The ACL role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The ACL role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_bfd/README.md b/roles/os10_bfd/README.md index f5c3b44..c690799 100644 --- a/roles/os10_bfd/README.md +++ b/roles/os10_bfd/README.md @@ -3,7 +3,7 @@ BFD role This role facilitates the configuration of bidirectional forwarding detection (BFD) global attributes. It specifically enables configuration of BFD interval, min_rx, multiplier, and role. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The BFD role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The BFD role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- @@ -21,8 +21,8 @@ Role variables | ``bfd`` | dictionary | Configures global BFD parameters (see ``bfd.*``) | os10 | | ``bfd.interval`` | integer | Configures the time interval in ms (100 to 1000) | os10 | | ``bfd.min_rx`` | integer | Configures maximum waiting time for receiving control packets from BFD peers in ms (100 to 1000)| os10 | -| ``bfd.multiplier`` | integer | Configure the maximum number of consecutive packets that are not received from BFD peers before session state changes to Down (3 to 50) | os10 | -| ``bfd.role`` | string: passive,active\* | Configure the BFD role | os10 | +| ``bfd.multiplier`` | integer | Configures the maximum number of consecutive packets that are not received from BFD peers before session state changes to Down (3 to 50) | os10 | +| ``bfd.role`` | string: passive,active\* | Configures the BFD role | os10 | | ``bfd.state`` | string: absent,present\* | Removes the global BFD if set to absent | os10 | > **NOTE**: Asterisk (\*) denotes the default value if none is specified. diff --git a/roles/os10_bgp/README.md b/roles/os10_bgp/README.md index d0f9960..e4e7c94 100644 --- a/roles/os10_bgp/README.md +++ b/roles/os10_bgp/README.md @@ -1,9 +1,9 @@ BGP role ======== -This role facilitates the configuration of border gateway protocol (BGP) attributes. It supports the configuration of router ID, networks, neighbors, and maximum path. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. +This role facilitates the configuration of border gateway protocol (BGP) attributes. It supports the configuration of router ID, networks, neighbors, and maximum paths. This role is abstracted for Dell EMC PowerSwitch platforms running SmartFabric OS10. -The BGP role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The BGP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- @@ -27,31 +27,53 @@ Role variables | ``fast_ext_fallover`` | boolean | Configures a reset session if a link to a directly connected external peer goes down | os10 | | ``always_compare_med`` | boolean | Configures comparing MED from different neighbors | os10 | | ``default_loc_pref`` | integer | Configures the default local preference value | os10 | +| ``as_notation`` | string | Configures AS number notation format | os10 | +| ``enforce_first_as`` | boolean | Configures the first AS for eBGP routes | os10 | +| ``non_deterministic_med`` | boolean | Configures nondeterministic path selection algorithm | os10 | +| ``outbound_optimization`` | boolean | Configures outbound optimization for iBGP peer-group members | os10 | | ``confederation`` | dictionary | Configures AS confederation parameters (see ``confederation.*``) | os10 | -| ``confederation.identifier`` | integer | Configures routing domain confederation AS | os10 | -| ``confederation.peers`` | string | Configures peer AS in BGP confederation | os10 | -| ``confederation.peers_state`` | string: absent,present\* | Deletes peer AS in BGP confederation if set to absent | os10 | +| ``confederation.identifier`` | integer | Configures the routing domain confederation AS | os10 | +| ``confederation.peers`` | string | Configures the peer AS in BGP confederation | os10 | +| ``confederation.peers_state`` | string: absent,present\* | Deletes the peer AS in BGP confederation if set to absent | os10 | | ``route_reflector`` | dictionary | Configures route reflection parameters (see ``route_reflector.*``) | os10 | | ``route_reflector.client_to_client`` | boolean | Configures client-to-client route reflection | os10 | -| ``route_reflector.cluster_id`` | string | Configures the route-reflector cluster-id | os10 | +| ``route_reflector.cluster_id`` | string | Configures the route reflector cluster-id | os10 | | ``address_family_ipv4`` | dictionary | Configures IPv4 address family parameters (see ``address_family_ipv4.*``) | os10 | | ``address_family_ipv4.aggregate_addr`` | list | Configures IPv4 BGP aggregate entries (see ``aggregate_addr.*``) | os10 | | ``aggregate_addr.ip_and_mask`` | string | Configures the IPv4 BGP aggregate address | os10 | -| ``address_family_ipv4.summary_only`` | boolean | Sets address to summary-only if true | os10 | +| ``aggregate_addr.adv_map`` | string | Configures the advertise map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.attr_map`` | string | Configures the attribute map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.suppress_map`` | string | Configures the suppress map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.summary_only`` | boolean | Sets address to summary only if true | os10 | | ``aggregate_addr.state`` | string: absent,present\* | Deletes an IPv4 BGP aggregate entry if set to absent | os10 | | ``address_family_ipv4.dampening`` | dictionary | Configures route-flap dampening (see ``dampening.*``) | os10 | | ``dampening.value`` | dictionary | Configures dampening values ( format; default 15 750 2000 60) | os10 | | ``dampening.route_map`` | string | Configures the route-map to specify criteria for dampening | os10 | | ``dampening.state`` | string: absent,present\* | Deletes dampening if set to absent | os10 | +| ``address_family_ipv4.ibgp_redist_internal`` | dictionary | Configures internal BGP reditribution (see ``ibgp_redist_internal.*``) | os10 | +| ``ibgp_redist_internal.state`` | boolean | Configures the internal BGP redistribution for an IPv4 address family | os10 | +| ``address_family_ipv4.default_metric`` | integer | Configures the metric of redistributed routes for IPv4 address family | os10 | +| ``address_family_ipv4.distance_bgp`` | dictionary | Configures BGP distances (see ``distance_bgp.*``) | os10 | +| ``distance_bgp.value`` | dictionary | Configures the BGP administrative distance for IPv4 address family ( format; distance bgp 2 3 4) | os10 | +| ``distance_bgp.state`` | string: absent,present\* | Deletes distance BGP if set to absent | os10 | | ``address_family_ipv6`` | dictionary | Configures IPv6 address family parameters (see ``address_family_ipv6.*``) | os10 | | ``address_family_ipv6.aggregate_addr`` | list | Configures IPv6 BGP aggregate entries (see ``aggregate_addr.*``) | os10 | | ``aggregate_addr.ip_and_mask`` | string | Configures the IPv6 BGP aggregate address | os10 | -| ``address_family_ipv6.summary_only`` | boolean | Sets address to summary-only if true | os10 | +| ``aggregate_addr.adv_map`` | string | Configures the advertise map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.attr_map`` | string | Configures the attribute map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.suppress_map`` | string | Configures the suppress map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.summary_only`` | boolean | Sets address to summary-only if true | os10 | | ``aggregate_addr.state`` | string: absent,present\* | Deletes an IPv6 BGP aggregate entry if set to absent | os10 | | ``address_family_ipv6.dampening`` | dictionary | Configures route-flap dampening (see ``dampening.*``) | os10 | | ``dampening.value`` | dictionary | Configures dampening values ( format; default 15 750 2000 60) | os10 | | ``dampening.route_map`` | string | Configures the route-map to specify criteria for dampening | os10 | | ``dampening.state`` | string: absent,present\* | Deletes dampening if set to absent | os10 | +| ``address_family_ipv6.ibgp_redist_internal`` | dictionary | Configures iBGP reditribution (see ``ibgp_redist_internal.*``) | os10 | +| ``ibgp_redist_internal.state`` | boolean | Configures the iBGP redistribution for an IPv6 address family | os10 | +| ``address_family_ipv6.default_metric`` | integer | Configures the metric of redistributed routes for IPv6 address family | os10 | +| ``address_family_ipv6.distance_bgp`` | dictionary | Configures BGP distances (see ``distance_bgp.*``) | os10 | +| ``distance_bgp.value`` | dictionary | Configures the BGP administrative distance for an IPv6 address family ( format; distance bgp 2 3 4) | os10 | +| ``distance_bgp.state`` | string: absent,present\* | Deletes distance BGP if set to absent | os10 | | ``best_path`` | list | Configures the default best-path selection (see ``best_path.*``) | os10 | | ``best_path.as_path`` | string (required): ignore,multipath-relax | Configures the AS path used for the best-path computation | os10 | | ``best_path.as_path_state`` | string: absent,present\* | Deletes the AS path configuration if set to absent | os10 | @@ -70,13 +92,13 @@ Role variables | ``neighbor.interface`` | string | Configures the BGP neighbor interface details | os10 | | ``neighbor.name`` | string (required) | Configures the BGP peer-group with this name; supported only when the neighbor is a peer group; mutually exclusive with *neighbor.ip* | os10 | | ``neighbor.type`` | string (required): ipv4,ipv6,peergroup | Specifies the BGP neighbor type | os10 | -| ``neighbor.auto_peer`` |string: unnumbered-auto | Enable AUTO discovery of neighbors | os10 | +| ``neighbor.auto_peer`` |string: unnumbered-auto | Enables auto discovery of neighbors | os10 | | ``neighbor.password`` | string | Configures the BGP neighbor password | os10 | -| ``neighbor.peergroup_type`` | string (ibgp, ebgp) | Configures the BGP neighbor peer group type| os10 | +| ``neighbor.peergroup_type`` | string (ibgp, ebgp) | Configures the BGP neighbor peer-group type| os10 | | ``neighbor.ebgp_peergroup`` | string | Configures the peer-group to all auto-discovered external neighbors | os10 | -| ``neighbor.ebgp_peergroup_state`` | string: present,absent | Removes the peer group from all auto-discovered external neighbors | os10 | +| ``neighbor.ebgp_peergroup_state`` | string: present,absent | Removes the peer-group from all auto-discovered external neighbors | os10 | | ``neighbor.ibgp_peergroup`` | string | Configures the peer-group to all auto-discovered internal neighbors | os10 | -| ``neighbor.ibgp_peergroup_state`` | string: present,absent | Removes the peer group from all auto-discovered internal neighbors | os10 | +| ``neighbor.ibgp_peergroup_state`` | string: present,absent | Removes the peer-group from all auto-discovered internal neighbors | os10 | | ``neighbor.route_reflector_client`` | boolean | Configures router reflector client on the BGP neighbor | os10 | | ``neighbor.local_as`` | integer | Configures the local AS for the BGP peer | os10 | | ``neighbor.weight`` | integer | Configures the default weight for routes from the neighbor interface | os10 | @@ -86,7 +108,7 @@ Role variables | ``neighbor.address_family`` | list | Configures address family commands on the BGP neighbor (see ``address_family.*``)| os10 | | ``address_family.type`` | string (required): ipv4,ipv6,l2vpn | Configures IPv4/IPv6/EVPN address family command mode on the BGP neighbor | os10 | | ``address_family.activate`` | boolean | Configures activation/deactivation of IPv4/IPv6 address family command mode on the BGP neighbor | os10 | -| ``address_family.sender_loop_detect`` | boolean | Enable/Disable the sender-side loop detection process for a BGP neighbor of IPv4/IPv6/l2vpn address family | os10 | +| ``address_family.sender_loop_detect`` | boolean | Enables/disables the sender-side loop detection process for a BGP neighbor of IPv4/IPv6/l2vpn address family | os10 | | ``address_family.allow_as_in`` | integer | Configures the local AS number in the as-path | os10 | | ``address_family.next_hop_self`` | boolean | Configures disabling the next-hop calculation for the neighbor | os10 | | ``address_family.soft_reconf`` | boolean | Configures per neighbor soft reconfiguration | os10 | @@ -94,7 +116,20 @@ Role variables | ``address_family.route_map`` | list | Configures the route-map on the BGP neighbor (see ``route_map.*``) | os10 | | ``route_map.name`` | string | Configures the name of the route-map for the BGP neighbor | os10 | | ``route_map.filter`` | string | Configures the filter for routing updates | os10 | -| ``route_map.state`` | string, choices: absent,present* | Deletes the route-map of the BGP neighbor if set to absent | os10 | +| ``route_map.state`` | string, choices: absent,present\* | Deletes the route-map of the BGP neighbor if set to absent | os10 | +| ``address_family.max_prefix`` | dictionary | Configures maximum-prefix parameters (see ``max_prefix.\*``) | os10 | +| ``max_prefix.count`` | integer | Configures maximum number of prefix accepted from the peer | os10 | +| ``max_prefix.state`` | string: absent,present | Deletes maximum prefix configured for the peer | os10 | +| ``max_prefix.threshold`` | integer | Configures threshold percentage at which warning log is thrown | os10 | +| ``max_prefix.warning``| boolean | Configures a warning without dropping the session when maximum limit exceeds if set to true | os10| +| ``address_family.default_originate`` | dictionary | Configures default-originate parameters (see ``default_originate.\*``) | os10 | +| ``default_originate.route_map`` | string | Configures the name of the route-map to specify criteria to originate default | os10 | +| ``default_originate.state`` | string, choices: absent,present\* | Deletes the default-originate if set to absent | os10 | +| ``address_family.distribute_list`` | list | Configures the distribute list to filter networks from routing updates (see ``distribute_list.*``) | os10 | +| ``distribute_list.in`` | string | Configures the name of the prefix-list to filter incoming packets | os10 | +| ``distribute_list.in_state`` | string: absent,present\* | Deletes the filter at incoming packets if set to absent | os10 | +| ``distribute_list.out`` | string | Configures the name of the prefix-list to filter outgoing packets | os10 | +| ``distribute_list.out_state`` | string: absent,present\* | Deletes the filter at outgoing packets if set to absent | os10 | | ``address_family.state`` | string: absent,present\* | Deletes the address family command mode of the BGP neighbor if set to absent | os10 | | ``neighbor.remote_asn`` | string (required) | Configures the remote AS number of the BGP neighbor | os10 | | ``neighbor.remote_asn_state`` | string: absent,present\* | Deletes the remote AS number from the peer group if set to absent; supported only when *neighbor.type* is "peergroup" | os10 | @@ -108,21 +143,26 @@ Role variables | ``distribute_list.out_state`` | string: absent,present\* | Deletes the filter at outgoing packets if set to absent | os10 | | ``neighbor.admin`` | string: up,down | Configures the administrative state of the neighbor | os10 | | ``neighbor.adv_interval`` | integer | Configures the advertisement interval of the neighbor | os10 | +| ``neighbor.adv_start`` | integer | Set the advertisement start of the neighbor | os10 | +| ``neighbor.adv_start_state`` | string: absent,present\* | Configures or unconfigures the advertisement start of a neighbor | os10 | +| ``neighbor.conn_retry_timer`` | integer | Configures the peer connection retry timer | os10 | +| ``neighbor.remove_pri_as`` | string: absent,present | Configures the remove private AS number from outbound updates | os10 | | ``neighbor.fall_over`` | string: absent,present | Configures the session fall on peer-route loss | os10 | -| ``neighbor.sender_loop_detect`` | boolean: true,false | Enables/disables the sender-side loop detect for neighbors | os10 | +| ``neighbor.sender_loop_detect`` | boolean: true,false | Enables or disables the sender-side loop detect for neighbors | os10 | | ``neighbor.src_loopback`` | integer | Configures the source loopback interface for routing packets | os10 | | ``neighbor.ebgp_multihop`` | integer | Configures the maximum-hop count value allowed in eBGP neighbors that are not directly connected (default 255) | os10 | -| ``neighbor.subnet`` | string (required) | Configures the passive BGP neighbor to this subnet | os10 | -| ``neighbor.subnet_state`` | string: absent,present\* | Deletes the subnet range set for dynamic IPv4 BGP neighbor if set to absent | os10 | -| ``neighbor.limit`` | integer | Configures maximum dynamic peers count (key is required together with ``neighbor.subnet``) | os10 | -| ``neighbor.bfd`` | boolean | Enables BDF for neighbor | os10 | +| ``neighbor.listen`` | list | Configures listen commands on the BGP template (see ``listen.*``)| os10 | +| ``listen.subnet`` | string (required) | Configures the passive BGP neighbor IPv4/IPv6 to this subnet | os10 | +| ``listen.subnet_state`` | string: absent,present\* | Deletes the subnet range set for dynamic IPv4/IPv6 BGP neighbor if set to absent | os10 | +| ``listen.limit`` | integer | Configures maximum dynamic peers count (key is required together with ``neighbor.subnet``) | os10 | +| ``neighbor.bfd`` | boolean | Enables BFD for neighbor | os10 | | ``neighbor.description`` | string | Configures neighbor description | os10 | | ``neighbor.state`` | string: absent,present\* | Deletes the IPv4 BGP neighbor if set to absent | os10 | | ``redistribute`` | list | Configures the redistribute list to get information from other routing protocols (see ``redistribute.*``) | os10 | -| ``redistribute.route_type`` | string (required): static,connected,imported_bgp | Configures the name of the routing protocol to redistribute | os10 | +| ``redistribute.route_type`` | string (required): static,connected,imported_bgp,l2vpn,ospf | Configures the name of the routing protocol to redistribute | os10 | | ``redistribute.route_map_name`` | string | Configures the route-map to redistribute | os10 | | ``redistribute.imported_bgp_vrf_name`` | string | Configures the redistribute imported BGP VRF name | os10 | -| ``redistribute.route_map`` | string: absent,present\* | Deletes the route-map to redistribute if set to absent | os10 | +| ``redistribute.ospf_id`` | string | Configures the redistribute OSPF | os10 | | ``redistribute.address_type`` | string (required): ipv4,ipv6 | Configures the address type of IPv4 or IPv6 routes | os10 | | ``redistribute.state`` | string: absent,present\* | Deletes the redistribution information if set to absent | os10 | | ``bfd_all_neighbors`` | dictionary | Enables BFD for all BGP neighbors | os10 | @@ -131,23 +171,158 @@ Role variables | ``bfd_all_neighbors.multiplier`` | integer: 3 to 50 | Configures maximum number of consecutive packets that are not received from BFD peers before session state changes to Down| os10 | | ``bfd_all_neighbors.role``| string: active, passive | Configures BFD role | os10 | | ``bfd_all_neighbors.state`` |string: absent,present\* | Deletes BFD for all neighbors if set to absent | os10 | -| ``state`` | string: absent,present\* | Deletes the local router BGP instance if set to absent | os10 | -| ``vrf`` | dictionary | Enables VRF under BGP | os10 | +| ``vrfs`` | list | Enables VRF under BGP | os10 | | ``vrf.name`` | string (Required)| Configures VRF name | os10 | -| ``vrf.router_id`` | string | Configures Router ID for VRF | os10 | -| ``vrf.address_family`` | dictionary | Enables address familyaddress | os10 | -| ``vrf.address_family.type`` | string (required): ipv4,ipv6 | Configures address type IPv4 or IPv6 | os10 | -| ``vrf.redistribute`` | dictionary | Enables redistribute option | os10 | -| ``vrf.redistribute.imported_bgp_vrf_name`` | string | Configures the redistribute imported BGP VRF name | os10 | -| ``vrf.redistribute.route_type`` | string (l2vpn, ospf, bgp, connected, imported_bgp) | Configure redistribute type | os10 | -| ``vrf.redistribute.address_type`` | string (required): ipv4,ipv6 | Configures address type IPv4 or IPv6 | os10 | -| ``vrf.redistribute.state `` | string (required) | Configures the state as present or absent | os10 | -| ``vrf.neighbor`` | list | Configures IPv4 BGP neighbors under VRF | os10 | -| ``vrf.neighbor.admin`` | string: up,down | Configures the administrative state of the neighbor in VRF | os10 | -| ``vrf.neighbor.type`` | string : ipv4,ipv6 | Specifies the BGP neighbor type under VRF | os10 | -| ``vrf.neighbor.ip`` | string | Configures the IP address of the BGP neighbor in VRF | os10 | -| ``vrf.neighbor.interface`` | string | Configures the BGP neighbor interface in VRF | os10 | -| ``vrf.neighbor.remote_asn`` | integer | Configures the remote AS for the BGP peer in VRF | os10 | +| ``vrf.router_id`` | string | Configures the IP address of the local BGP router instance in VRF | os10 | +| ``vrf.graceful_restart`` | boolean | Configures graceful restart capability in VRF | os10 | +| ``vrf.maxpath_ibgp`` | integer | Configures the maximum number of paths to forward packets through iBGP (1 to 64; default 1) in VRF | os10 | +| ``vrf.maxpath_ebgp`` | integer | Configures the maximum number of paths to forward packets through eBGP (1 to 64; default 1) in VRF | os10 | +| ``vrf.log_neighbor_changes`` | boolean | Configures log neighbors up/down in VRF | os10 | +| ``vrf.fast_ext_fallover`` | boolean | Configures a reset session if a link to a directly connected external peer goes down in VRF | os10 | +| ``vrf.always_compare_med`` | boolean | Configures comparing MED from different neighbors in VRF | os10 | +| ``vrf.default_loc_pref`` | integer | Configures the default local preference value in VRF | os10 | +| ``vrf.as_notation`` | string | Changes the AS number notation format in VRF | os10 | +| ``vrf.enforce_first_as`` | boolean | Configures the first AS for eBGP routes in VRF | os10 | +| ``vrf.non_deterministic_med`` | boolean | Configures nondeterministic path selection algorithm in VRF | os10 | +| ``vrf.outbound_optimization`` | boolean | Configures outbound optimization for iBGP peer-group members in VRF | os10 | +| ``vrf.route_reflector`` | dictionary | Configures route reflection parameters (see ``route_reflector.*``) in VRF | os10 | +| ``vrf.route_reflector.client_to_client`` | boolean | Configures client-to-client route reflection in VRF | os10 | +| ``vrf.route_reflector.cluster_id`` | string | Configures the route-reflector cluster-id in VRF | os10 | +| ``vrf.address_family_ipv4`` | dictionary | Configures IPv4 address family parameters in VRF (see ``address_family_ipv4.*``) in VRF | os10 | +| ``address_family_ipv4.aggregate_addr`` | list | Configures IPv4 BGP aggregate entries (see ``aggregate_addr.*``) in VRF | os10 | +| ``aggregate_addr.ip_and_mask`` | string | Configures the IPv4 BGP aggregate address in VRF | os10 | +| ``aggregate_addr.adv_map`` | string | Configures the advertise map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.attr_map`` | string | Configures the attribute map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.suppress_map`` | string | Configures the suppress map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.summary_only`` | boolean | Sets address to summary-only if true in VRF | os10 | +| ``aggregate_addr.state`` | string: absent,present\* | Deletes an IPv4 BGP aggregate entry if set to absent in VRF | os10 | +| ``address_family_ipv4.dampening`` | dictionary | Configures route-flap dampening (see ``dampening.*``) | os10 | +| ``dampening.value`` | dictionary | Configures dampening values ( format; default 15 750 2000 60) | os10 | +| ``dampening.route_map`` | string | Configures the route-map to specify criteria for dampening | os10 | +| ``dampening.state`` | string: absent,present\* | Deletes dampening if set to absent | os10 | +| ``address_family_ipv4.ibgp_redist_internal`` | dictionary | Configures iBGP reditribution (see ``ibgp_redist_internal.*``) | os10 | +| ``ibgp_redist_internal.state`` | boolean | Configures the iBGP redistribution for a IPV4 address family | os10 | +| ``address_family_ipv4.default_metric`` | integer | Configures the metric of redistributed routes for IPV4 address family | os10 | +| ``address_family_ipv4.distance_bgp`` | dictionary | Configures BGP distances (see ``distance_bgp.*``) | os10 | +| ``distance_bgp.value`` | dictionary | Configures the BGP administrative distance for IPV4 address family ( format; distance bgp 2 3 4) | os10 | +| ``distance_bgp.state`` | string: absent,present\* | Deletes distance BGP if set to absent | os10 | +| ``vrf.address_family_ipv6`` | dictionary | Configures IPv6 address family parameters in VRF (see ``address_family_ipv6.*``) | os10 | +| ``address_family_ipv6.aggregate_addr`` | list | Configures IPv6 BGP aggregate entries (see ``aggregate_addr.*``) | os10 | +| ``aggregate_addr.ip_and_mask`` | string | Configures the IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.adv_map`` | string | Configures the advertise map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.attr_map`` | string | Configures the attribute map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.suppress_map`` | string | Configures the suppress map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.summary_only`` | boolean | Sets address to summary-only if true | os10 | +| ``aggregate_addr.state`` | string: absent,present\* | Deletes an IPv6 BGP aggregate entry if set to absent | os10 | +| ``address_family_ipv6.dampening`` | dictionary | Configures route-flap dampening (see ``dampening.*``) | os10 | +| ``dampening.value`` | dictionary | Configures dampening values ( format; default 15 750 2000 60) | os10 | +| ``dampening.route_map`` | string | Configures the route-map to specify criteria for dampening | os10 | +| ``dampening.state`` | string: absent,present\* | Deletes dampening if set to absent | os10 | +| ``address_family_ipv6.ibgp_redist_internal`` | dictionary | Configures iBGP reditribution (see ``ibgp_redist_internal.*``) | os10 | +| ``ibgp_redist_internal.state`` | boolean | Configures the iBGP redistribution for a IPv6 address family | os10 | +| ``address_family_ipv6.default_metric`` | integer | Configures the metric of redistributed routes for IPv6 address family | os10 | +| ``address_family_ipv6.distance_bgp`` | dictionary | Configures BGP distances (see ``distance_bgp.*``) | os10 | +| ``distance_bgp.value`` | dictionary | Configures the BGP administrative distance for IPv6 address family ( format; distance bgp 2 3 4) | os10 | +| ``distance_bgp.state`` | string: absent,present\* | Deletes distance BGP if set to absent | os10 | +| ``vrf.best_path`` | list | Configures the default best-path selection in VRF (see ``best_path.*``) | os10 | +| ``best_path.as_path`` | string (required): ignore,multipath-relax | Configures the AS path used for the best-path computation | os10 | +| ``best_path.as_path_state`` | string: absent,present\* | Deletes the AS path configuration if set to absent | os10 | +| ``best_path.ignore_router_id`` | boolean: true,false | Ignores the router identifier in best-path computation if set to true | os10 | +| ``best_path.med`` | list | Configures the MED attribute (see ``med.*``) | os10 | +| ``med.attribute`` | string (required): confed,missing-as-best | Configures the MED attribute used for the best-path computation | os10 | +| ``med.state`` | string: absent,present\* | Deletes the MED attribute if set to absent | os10 | +| ``vrf.ipv4_network`` | list | Configures an IPv4 BGP networks (see ``ipv4_network.*``) | os10 | +| ``ipv4_network.address`` | string (required) | Configures the IPv4 address of the BGP network (A.B.C.D/E format) | os10 | +| ``ipv4_network.state`` | string: absent,present\* | Deletes an IPv4 BGP network if set to absent | os10 | +| ``vrf.ipv6_network`` | list | Configures an IPv6 BGP network (see ``ipv6_network.*``) | os10 | +| ``ipv6_network.address`` | string (required) | Configures the IPv6 address of the BGP network (2001:4898:5808:ffa2::1/126 format) | os10 | +| ``ipv6_network.state`` | string: absent,present\* | Deletes an IPv6 BGP network if set to absent | os10 | +| ``vrf.neighbor`` | list | Configures IPv4 BGP neighbors in VRF (see ``neighbor.*``) | os10 | +| ``neighbor.ip`` | string (required) | Configures the IPv4 address of the BGP neighbor (10.1.1.1) | os10 | +| ``neighbor.interface`` | string | Configures the BGP neighbor interface details | os10 | +| ``neighbor.name`` | string (required) | Configures the BGP peer-group with this name; supported only when the neighbor is a peer group; mutually exclusive with *neighbor.ip* | os10 | +| ``neighbor.type`` | string (required): ipv4,ipv6,peergroup | Specifies the BGP neighbor type | os10 | +| ``neighbor.auto_peer`` |string: unnumbered-auto | Enable auto-discovery of neighbors | os10 | +| ``neighbor.password`` | string | Configures the BGP neighbor password | os10 | +| ``neighbor.peergroup_type`` | string (ibgp, ebgp) | Configures the BGP neighbor peer-group type| os10 | +| ``neighbor.ebgp_peergroup`` | string | Configures the peer-group to all auto-discovered external neighbors | os10 | +| ``neighbor.ebgp_peergroup_state`` | string: present,absent | Removes the peer-group from all auto-discovered external neighbors | os10 | +| ``neighbor.ibgp_peergroup`` | string | Configures the peer-group to all auto-discovered internal neighbors | os10 | +| ``neighbor.ibgp_peergroup_state`` | string: present,absent | Removes the peer-group from all auto-discovered internal neighbors | os10 | +| ``neighbor.route_reflector_client`` | boolean | Configures router reflector client on the BGP neighbor | os10 | +| ``neighbor.local_as`` | integer | Configures the local AS for the BGP peer | os10 | +| ``neighbor.weight`` | integer | Configures the default weight for routes from the neighbor interface | os10 | +| ``neighbor.send_community`` | list | Configures the send community attribute to the BGP neighbor (see ``send_community.*``) | os10 | +| ``send_community.type`` | string (required) | Configures the send community attribute to the BGP neighbor | os10 | +| ``send_community.state`` | string: absent,present\* | Deletes the send community attribute of the BGP neighbor if set to absent | os10 | +| ``neighbor.address_family`` | list | Configures address family commands on the BGP neighbor (see ``address_family.*``)| os10 | +| ``address_family.type`` | string (required): ipv4,ipv6,l2vpn | Configures IPv4/IPv6 EVPN address family command mode on the BGP neighbor | os10 | +| ``address_family.activate`` | boolean | Configures activation or deactivation of IPv4/IPv6 address family command mode on the BGP neighbor | os10 | +| ``address_family.sender_loop_detect`` | boolean | Enables or disables the sender-side loop detection process for a BGP neighbor of IPv4/IPv6 l2vpn address family | os10 | +| ``address_family.allow_as_in`` | integer | Configures the local AS number in the as-path | os10 | +| ``address_family.next_hop_self`` | boolean | Configures disabling the next-hop calculation for the neighbor | os10 | +| ``address_family.soft_reconf`` | boolean | Configures per neighbor soft reconfiguration | os10 | +| ``address_family.add_path`` | string | Configures send or receive multiple paths (value can be 'both ', 'send ', 'receive')| os10 | +| ``address_family.route_map`` | list | Configures the route-map on the BGP neighbor (see ``route_map.*``) | os10 | +| ``route_map.name`` | string | Configures the name of the route-map for the BGP neighbor | os10 | +| ``route_map.filter`` | string | Configures the filter for routing updates | os10 | +| ``route_map.state`` | string, choices: absent,present* | Deletes the route-map of the BGP neighbor if set to absent | os10 | +| ``address_family.max_prefix`` | dictionary | Configures maximum-prefix parameters (see ``max_prefix.*``) | os10 | +| ``max_prefix.count`` | integer | Configures maximum number of prefix accepted from the peer | os10 | +| ``max_prefix.state`` | string: absent,present | Deletes maximum prefix configured for the peer | os10 | +| ``max_prefix.threshold`` | integer | Configures threshold percentage at which warning log is thrown | os10 | +| ``max_prefix.warning``| boolean | Configures a warning without dropping session when maximum limit exceeds if set to true | os10| +| ``address_family.default_originate`` | dictionary | Configures default-originate parameters (see ``default_originate.\*``) | os10 | +| ``default_originate.route_map`` | string | Configures the name of the route-map to specify criteria to originate default | os10 | +| ``default_originate.state`` | string, choices: absent,present\* | Deletes the default-originate if set to absent | os10 | +| ``address_family.distribute_list`` | list | Configures the distribute list to filter networks from routing updates (see ``distribute_list.*``) | os10 | +| ``distribute_list.in`` | string | Configures the name of the prefix-list to filter incoming packets | os10 | +| ``distribute_list.in_state`` | string: absent,present\* | Deletes the filter at incoming packets if set to absent | os10 | +| ``distribute_list.out`` | string | Configures the name of the prefix-list to filter outgoing packets | os10 | +| ``distribute_list.out_state`` | string: absent,present\* | Deletes the filter at outgoing packets if set to absent | os10 | +| ``address_family.state`` | string: absent,present\* | Deletes the address family command mode of the BGP neighbor if set to absent | os10 | +| ``neighbor.remote_asn`` | string (required) | Configures the remote AS number of the BGP neighbor | os10 | +| ``neighbor.remote_asn_state`` | string: absent,present\* | Deletes the remote AS number from the peer-group if set to absent; supported only when *neighbor.type* is "peergroup" | os10 | +| ``neighbor.timer`` | string | Configures neighbor timers; 5 10, where 5 is the keepalive interval and 10 is the holdtime | os10 | +| ``neighbor.peergroup`` | string | Configures neighbor to BGP peer-group (configured peer-group name) | os10 | +| ``neighbor.peergroup_state`` | string: absent,present\* | Deletes the IPv4 BGP neighbor from the peer-group if set to absent | os10 | +| ``neighbor.distribute_list`` | list | Configures the distribute list to filter networks from routing updates (see ``distribute_list.*``) | os10 | +| ``distribute_list.in`` | string | Configures the name of the prefix-list to filter incoming packets | os10 | +| ``distribute_list.in_state`` | string: absent,present\* | Deletes the filter at incoming packets if set to absent | os10 | +| ``distribute_list.out`` | string | Configures the name of the prefix-list to filter outgoing packets | os10 | +| ``distribute_list.out_state`` | string: absent,present\* | Deletes the filter at outgoing packets if set to absent | os10 | +| ``neighbor.admin`` | string: up,down | Configures the administrative state of the neighbor | os10 | +| ``neighbor.adv_interval`` | integer | Configures the advertisement interval of the neighbor | os10 | +| ``neighbor.adv_start`` | integer | Set the advertisement start of the neighbor | os10 | +| ``neighbor.adv_start_state`` | string: absent,present\* | Configures or unconfigures the advertisement start of the neighbor | os10 | +| ``neighbor.conn_retry_timer`` | integer | Configures the peer connection retry timer | os10 | +| ``neighbor.remove_pri_as`` | string: absent,present | Removes private AS number from outbound updates | os10 | +| ``neighbor.fall_over`` | string: absent,present | Configures the session fall on peer-route loss | os10 | +| ``neighbor.sender_loop_detect`` | boolean: true,false | Enables or disables the sender-side loop detect for neighbors | os10 | +| ``neighbor.src_loopback`` | integer | Configures the source loopback interface for routing packets | os10 | +| ``neighbor.ebgp_multihop`` | integer | Configures the maximum-hop count value allowed in eBGP neighbors that are not directly connected (default 255) | os10 | +| ``neighbor.listen`` | list | Configures listen commands on the BGP template (see ``listen.*``)| os10 | +| ``listen.subnet`` | string (required) | Configures the passive BGP neighbor IPv4/IPv6 to this subnet | os10 | +| ``listen.subnet_state`` | string: absent,present\* | Deletes the subnet range set for dynamic IPv4/IPv6 BGP neighbor if set to absent | os10 | +| ``listen.limit`` | integer | Configures maximum dynamic peers count (key is required together with ``neighbor.subnet``) | os10 | +| ``neighbor.bfd`` | boolean | Enables BFD for neighbor | os10 | +| ``neighbor.description`` | string | Configures neighbor description | os10 | +| ``neighbor.state`` | string: absent,present\* | Deletes the IPv4 BGP neighbor if set to absent | os10 | +| ``vrf.redistribute`` | list | Configures the redistribute list to get information from other routing protocols in VRF (see ``redistribute.*``) | os10 | +| ``redistribute.route_type`` | string (required): static,connected,imported_bgp | Configures the name of the routing protocol to redistribute | os10 | +| ``redistribute.route_map_name`` | string | Configures the route-map to redistribute | os10 | +| ``redistribute.imported_bgp_vrf_name`` | string | Configures the redistribute imported BGP VRF name | os10 | +| ``redistribute.ospf_id`` | string | Configures the redistribute ospf | os10 | +| ``redistribute.address_type`` | string (required): ipv4,ipv6 | Configures the address type of IPv4 or IPv6 routes | os10 | +| ``redistribute.state`` | string: absent,present\* | Deletes the redistribution information if set to absent | os10 | +| ``vrf.bfd_all_neighbors`` | dictionary | Enables BFD for all BGP neighbors in VRF ((see ``bfd_all_neighbors.*``))| os10 | +| ``bfd_all_neighbors.interval`` | integer: 100 to 1000 | Configures time interval for sending control packets to BFD peers in ms| os10 | +| ``bfd_all_neighbors.min_rx`` | integer: 100 to 1000 | Configures maximum waiting time for receiving control packets from BFD peers in ms| os10 | +| ``bfd_all_neighbors.multiplier`` | integer: 3 to 50 | Configures maximum number of consecutive packets that are not received from BFD peers before session state changes to Down| os10 | +| ``bfd_all_neighbors.role``| string: active, passive | Configures BFD role | os10 | +| ``bfd_all_neighbors.state`` |string: absent,present\* | Deletes BFD for all neighbors if set to absent | os10 | +| ``vrf.state`` | string: absent,present\* | Deletes the VRF instance under router BGP if set to absent | os10 | +| ``state`` | string: absent,present\* | Deletes the local router BGP instance if set to absent | os10 | > **NOTE**: Asterisk (\*) denotes the default value if none is specified. @@ -202,6 +377,10 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio fast_ext_fallover: false always_compare_med: true default_loc_pref: 1000 + as_notation: asdot + enforce_first_as: false + non_deterministic_med: true + outbound_optimization: true confederation: identifier: 25 peers: 23 24 @@ -218,11 +397,19 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio value: 15 750 2000 60 route_map: qq state: present + ibgp_redist_internal: + state: present + default_metric: 10 + distance_bgp: + value: 3 4 6 + state: present address_family_ipv6: aggregate_address: - ip_and_mask: 2001:4898:5808:ffa0::/126 state: present summary_only: true + ibgp_redist_internal: + state: present best_path: as_path: ignore as_path_state: present @@ -241,6 +428,22 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio type: peergroup bfd: yes state: present + address_family: + - type: ipv4 + activate: false + state: present + max_prefix: + count: 20 + threshold: 90 + warning: true + state: present + listen: + - subnet: 4.4.4.4/32 + limit: 4 + subnet_state: present + - subnet: 20::/64 + limit: 4 + subnet_state: present - name: ibgp_pg type: peergroup weight: 10 @@ -267,11 +470,28 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio fall_over: present password: bgppassword route_reflector_client: true + adv_start: 100 + adv_start_state: present + conn_retry_timer: 20 + remove_pri_as: present src_loopback: 0 address_family: - type: ipv4 activate: true state: present + max_prefix: + count: 10 + threshold: 40 + warning: true + state: present + default_originate: + route_map: aa + state: present + distribute_list: + in: XX + in_state: present + out: YY + out_state: present send_community: - type: standard state: present @@ -335,19 +555,164 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio multiplier: 3 role: active state: present - vrf : - name: "GREEN" - address_family: - type: ipv4 - redistribute: - - route_type: l2vpn - address_type: ipv4 + vrfs: + - name: "GREEN" + router_id: 50.1.1.1 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: false + fast_ext_fallover: false + always_compare_med: true + default_loc_pref: 1000 + route_reflector: + client_to_client: false + cluster_id: 1 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + - attribute: missing-as-worst + state: present + ipv4_network: + - address: 101.1.1.0/30 state: present - neighbor: - - type: ipv4 - ip: "172.16.1.1" - remote_asn: 65400 - admin: up + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: peer1 + type: peergroup + bfd: yes + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan10 + description: U_site2 vlan + send_community: + - type: extended + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.20.1 + name: peer1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + route_reflector_client: true + src_loopback: 0 + address_family: + - type: ipv4 + activate: false + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.15.3 + address_family: + - type: ipv4 + activate: false + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ebgp_peergroup: ebgp_pg + ebgp_peergroup_state: present + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + address_family: + - type: ipv4 + activate: false + sender_loop_detect: false + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + - route_type: connected + route_map_name: bb + address_type: ipv4 + state: present + - route_type: l2vpn + route_map_name: cc + address_type: ipv4 + state: present + - route_type: imported_bgp + imported_bgp_vrf_name: test6 + route_map_name: dd + address_type: ipv4 + state: present + - route_type: ospf + ospf_id: 12 + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + state: present state: present @@ -361,4 +726,4 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio ansible-playbook -i hosts leaf.yaml -(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. \ No newline at end of file +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/roles/os10_bgp/templates/os10_bgp.j2 b/roles/os10_bgp/templates/os10_bgp.j2 index 68689e0..d4859eb 100644 --- a/roles/os10_bgp/templates/os10_bgp.j2 +++ b/roles/os10_bgp/templates/os10_bgp.j2 @@ -28,11 +28,15 @@ os10_bgp: value: 15 750 2000 60 route_map: qq state: present + ibgp_redist_internal: + state: present address_family_ipv6: aggregate_address: - ip_and_mask: 2001:4898:5808:ffa0::/126 state: present summary_only: true + ibgp_redist_internal: + state: present best_path: as_path: ignore as_path_state: present @@ -102,6 +106,11 @@ os10_bgp: - name: qq filter: in state: present + max_prefix: + - count: 10 + threshold: 80 + warning: true + state: present state: present state: present - type: ipv6 @@ -145,325 +154,169 @@ os10_bgp: multiplier: 3 role: active state: present - vrf : - name: "GREEN" - address_family: - type: ipv4 - redistribute: - - route_type: l2vpn - address_type: ipv4 - state: present - neighbor: - - type: ipv4 - ip: "172.16.1.1" - remote_asn: 65400 - admin: up + vrfs : + - name: "GREEN" + router_id: 1.1.1.1 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + summary_only: true + state: present + neighbor: + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan20 + send_community: + - type: extended + state: present + address_family: + - type: l2vpn + activate: true + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2-spine1" + remote_asn: 11 + ip: 192.168.10.1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + password: bgppassword + route_reflector_client: true + src_loopback: 0 + address_family: + - type: ipv4 + activate: true + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: true + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ebgp_peergroup: ebgp_pg + ebgp_peergroup_state: absent + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + sender_loop_detect: true + password: bgppassword + address_family: + - type: ipv4 + activate: true + sender_loop_detect: true + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + - type: l2vpn + activate: true + sender_loop_detect: false + state: present + send_community: + - type: standard + state: present + admin: up + state: present + state: present state: present ################################} -{% if os10_bgp is defined and os10_bgp %} -{% set bgp_vars = os10_bgp %} -{% if bgp_vars.state is defined and bgp_vars.state == "absent" %} -no router bgp -{% else %} - {# Add Feature to the switch #} - {% if bgp_vars.asn is defined and bgp_vars.asn %} -router bgp {{ bgp_vars.asn }} - {% if bgp_vars.router_id is defined %} - {% if bgp_vars.router_id %} - router-id {{ bgp_vars.router_id }} - {% else %} - no router-id - {% endif %} - {% endif %} - - {% if bgp_vars.bfd_all_neighbors is defined and bgp_vars.bfd_all_neighbors is defined %} - {% if bgp_vars.bfd_all_neighbors.state is defined and bgp_vars.bfd_all_neighbors.state == "absent"%} - no bfd all-neighbors - {% else %} - {% set bfd_vars = bgp_vars.bfd_all_neighbors %} - {% if bfd_vars.interval is defined and bfd_vars.min_rx is defined and bfd_vars.multiplier is defined %} - bfd all-neighbors interval {{ bfd_vars.interval }} min_rx {{ bfd_vars.min_rx }} multiplier {{ bfd_vars.multiplier }} role {{ bfd_vars.role }} - {% else %} - bfd all-neighbors - {% endif %} - {% endif %} - {% endif %} - - {% if bgp_vars.log_neighbor_changes is defined %} - {% if bgp_vars.log_neighbor_changes %} - log-neighbor-changes - {% else %} - no log-neighbor-changes - {% endif %} - {% endif %} - - {% if bgp_vars.maxpath_ebgp is defined %} - {% if bgp_vars.maxpath_ebgp %} - maximum-paths ebgp {{ bgp_vars.maxpath_ebgp }} - {% else %} - no maximum-paths ebgp - {% endif %} - {% endif %} - - {% if bgp_vars.maxpath_ibgp is defined %} - {% if bgp_vars.maxpath_ibgp %} - maximum-paths ibgp {{ bgp_vars.maxpath_ibgp }} - {% else %} - no maximum-paths ibgp - {% endif %} - {% endif %} - - {% if bgp_vars.graceful_restart is defined %} - {% if bgp_vars.graceful_restart %} - graceful-restart role receiver-only - {% else %} - no graceful-restart role receiver-only +{% macro render_default_metric_configs(af_vars) %} + {% if af_vars.default_metric is defined %} + {% if af_vars.default_metric %} + default-metric {{ af_vars.default_metric }} + {% else %} + no default-metric + {% endif %} {% endif %} - {% endif %} +{% endmacro %} - {% if bgp_vars.always_compare_med is defined %} - {% if bgp_vars.always_compare_med %} - always-compare-med +{% macro render_outbound_optimization_configs(out_opt_vars) %} + {% if out_opt_vars %} + outbound-optimization {% else %} - no always-compare-med + outbound-optimization {% endif %} - {% endif %} +{% endmacro %} - {% if bgp_vars.default_loc_pref is defined %} - {% if bgp_vars.default_loc_pref %} - default local-preference {{ bgp_vars.default_loc_pref }} +{% macro render_non_deterministic_med_configs(non_deter_med_vars) %} + {% if non_deter_med_vars %} + non-deterministic-med {% else %} - no default local-preference + no non-deterministic-med {% endif %} - {% endif %} +{% endmacro %} - {% if bgp_vars.fast_ext_fallover is defined %} - {% if bgp_vars.fast_ext_fallover %} - fast-external-fallover +{% macro render_enforce_first_as_configs(enforce_first_as_vars) %} + {% if enforce_first_as_vars %} + enforce-first-as {% else %} - no fast-external-fallover - {% endif %} - {% endif %} - - {% if bgp_vars.confederation is defined and bgp_vars.confederation %} - {% if bgp_vars.confederation.identifier is defined %} - {% if bgp_vars.confederation.identifier %} - confederation identifier {{ bgp_vars.confederation.identifier }} - {% else %} - no confederation identifier 1 - {% endif %} - {% endif %} - {% if bgp_vars.confederation.peers is defined and bgp_vars.confederation.peers %} - {% if bgp_vars.confederation.peers_state is defined and bgp_vars.confederation.peers_state == "absent" %} - no confederation peers {{ bgp_vars.confederation.peers }} - {% else %} - confederation peers {{ bgp_vars.confederation.peers }} - {% endif %} - {% endif %} - {% endif %} - - {% if bgp_vars.route_reflector is defined and bgp_vars.route_reflector %} - {% if bgp_vars.route_reflector.client_to_client is defined %} - {% if bgp_vars.route_reflector.client_to_client %} - client-to-client reflection - {% else %} - no client-to-client reflection - {% endif %} - {% endif %} - {% if bgp_vars.route_reflector.cluster_id is defined %} - {% if bgp_vars.route_reflector.cluster_id %} - cluster-id {{ bgp_vars.route_reflector.cluster_id }} - {% else %} - no cluster-id 1 - {% endif %} - {% endif %} - {% endif %} - - {% if bgp_vars.best_path is defined and bgp_vars.best_path %} - {% if bgp_vars.best_path.as_path is defined and bgp_vars.best_path.as_path %} - {% if bgp_vars.best_path.as_path_state is defined and bgp_vars.best_path.as_path_state == "absent" %} - no bestpath as-path {{ bgp_vars.best_path.as_path }} - {% else %} - bestpath as-path {{ bgp_vars.best_path.as_path }} - {% endif %} - {% endif %} - {% if bgp_vars.best_path.ignore_router_id is defined %} - {% if bgp_vars.best_path.ignore_router_id %} - bestpath router-id ignore - {% else %} - no bestpath router-id ignore - {% endif %} - {% endif %} - {% if bgp_vars.best_path.med is defined and bgp_vars.best_path.med %} - {% for med in bgp_vars.best_path.med %} - {% if med.attribute is defined and med.attribute %} - {% if med.state is defined and med.state == "absent" %} - no bestpath med {{ med.attribute }} - {% else %} - bestpath med {{ med.attribute }} - {% endif %} - {% endif %} - {% endfor %} - {% endif %} - {% endif %} - - {% if bgp_vars.address_family_ipv4 is defined and bgp_vars.address_family_ipv4 %} - {% set af_vars = bgp_vars.address_family_ipv4 %} - address-family ipv4 unicast - {% endif %} - {% if af_vars is defined and af_vars %} - {% if af_vars.aggregate_address is defined and af_vars.aggregate_address %} - {% for addr in af_vars.aggregate_address %} - {% if addr.ip_and_mask is defined and addr.ip_and_mask %} - {% if addr.state is defined and addr.state == "absent" %} - no aggregate-address {{ addr.ip_and_mask }} - {% else %} - {% if addr.summary_only is defined and addr.summary_only %} - aggregate-address {{ addr.ip_and_mask }} summary-only - {% else %} - aggregate-address {{ addr.ip_and_mask }} - {% endif %} - {% endif %} - {% endif %} - {% endfor %} - {% endif %} - {% if af_vars.dampening is defined and af_vars.dampening %} - {% if af_vars.dampening.state is defined and af_vars.dampening.state == "absent" %} - no dampening - {% else %} - {% if af_vars.dampening.value is defined and af_vars.dampening.value %} - {% if af_vars.dampening.route_map is defined and af_vars.dampening.route_map %} - dampening {{ af_vars.dampening.value }} route-map {{ af_vars.dampening.route_map }} - {% else %} - dampening {{ af_vars.dampening.value }} - {% endif %} - {% else %} - {% if af_vars.dampening.route_map is defined and af_vars.dampening.route_map %} - dampening 15 750 2000 60 route-map {{ af_vars.dampening.route_map }} - {% endif %} - {% endif %} - {% endif %} - {% endif %} - {% endif %} - - {% if bgp_vars.address_family_ipv6 is defined and bgp_vars.address_family_ipv6 %} - {% set af_vars = bgp_vars.address_family_ipv6 %} - address-family ipv6 unicast - {% endif %} - {% if af_vars is defined and af_vars %} - {% if af_vars.aggregate_address is defined and af_vars.aggregate_address %} - {% for addr in af_vars.aggregate_address %} - {% if addr.ip_and_mask is defined and addr.ip_and_mask %} - {% if addr.state is defined and addr.state == "absent" %} - no aggregate-address {{ addr.ip_and_mask }} - {% else %} - {% if addr.summary_only is defined and addr.summary_only %} - aggregate-address {{ addr.ip_and_mask }} summary-only - {% else %} - aggregate-address {{ addr.ip_and_mask }} - {% endif %} - {% endif %} - {% endif %} - {% endfor %} - {% endif %} - {% if af_vars.dampening is defined and af_vars.dampening %} - {% if af_vars.dampening.state is defined and af_vars.dampening.state == "absent" %} - no dampening - {% else %} - {% if af_vars.dampening.value is defined and af_vars.dampening.value %} - {% if af_vars.dampening.route_map is defined and af_vars.dampening.route_map %} - dampening {{ af_vars.dampening.value }} route-map {{ af_vars.dampening.route_map }} - {% else %} - dampening {{ af_vars.dampening.value }} - {% endif %} - {% else %} - {% if af_vars.dampening.route_map is defined and af_vars.dampening.route_map %} - dampening 15 750 2000 60 route-map {{ af_vars.dampening.route_map }} - {% endif %} - {% endif %} - {% endif %} + no enforce-first-as {% endif %} - {% endif %} - - {% if bgp_vars.ipv4_network is defined and bgp_vars.ipv4_network %} - address-family ipv4 unicast - {% for net in bgp_vars.ipv4_network %} - {% if net.address is defined and net.address %} - {% if net.state is defined and net.state == "absent"%} - no network {{ net.address }} - {% else %} - network {{ net.address }} - {% endif %} - {% endif %} - {% endfor %} - {% endif %} - - {% if bgp_vars.ipv6_network is defined and bgp_vars.ipv6_network %} - address-family ipv6 unicast - {% for net in bgp_vars.ipv6_network %} - {% if net.address is defined and net.address %} - {% if net.state is defined and net.state == "absent"%} - no network {{ net.address }} - {% else %} - network {{ net.address }} - {% endif %} - {% endif %} - {% endfor %} - {% endif %} +{% endmacro %} - {% if bgp_vars.redistribute is defined and bgp_vars.redistribute %} - {% for route in bgp_vars.redistribute %} - {% if route.route_type is defined and route.route_type %} - {% if route.address_type is defined and route.address_type %} - address-family {{ route.address_type }} unicast - {% if route.state is defined and route.state == "absent" %} - {% if route.route_type == "imported_bgp" %} - no redistribute imported-bgp-routes vrf {{ route.imported_bgp_vrf_name }} - {% else %} - no redistribute {{ route.route_type }} - {% endif %} - {% else %} - {% if route.route_map_name is defined and route.route_map_name %} - {% if route.route_type == "imported_bgp" %} - redistribute imported-bgp-routes vrf {{ route.imported_bgp_vrf_name }} route-map {{ route.route_map_name }} - {% else %} - redistribute {{ route.route_type }} route-map {{ route.route_map_name }} - {% endif %} - {% else %} - {% if route.route_type == "imported_bgp" %} - redistribute imported-bgp-routes vrf {{ route.imported_bgp_vrf_name }} - {% else %} - redistribute {{ route.route_type }} - {% endif %} - {% endif %} - {% endif %} - {% endif %} - {% endif %} - {% endfor %} - {% endif %} +{% macro render_as_notation_configs(as_vars) %} + {% if as_vars %} + as-notation {{ as_vars }} + {% endif %} +{% endmacro %} - {% if bgp_vars.neighbor is defined and bgp_vars.neighbor %} - {% for neighbor in bgp_vars.neighbor %} +{% macro render_neigh_configs(neigh_vars,indent_space) %} + {% if neigh_vars is defined and neigh_vars %} + {% for neighbor in neigh_vars %} {% if neighbor.type is defined %} {% if neighbor.type == "ipv4" or neighbor.type =="ipv6" %} {% if neighbor.ip is defined and neighbor.ip %} {% set tag_or_ip = neighbor.ip %} {% if neighbor.state is defined and neighbor.state == "absent" %} - no neighbor {{ tag_or_ip }} + {{ indent_space }}no neighbor {{ tag_or_ip }} {% else %} - neighbor {{ tag_or_ip }} + {{ indent_space }}neighbor {{ tag_or_ip }} {% if neighbor.description is defined %} {% if neighbor.description %} - description "{{ neighbor.description }}" + {{ indent_space }}description "{{ neighbor.description }}" {% else %} - no description + {{ indent_space }}no description {% endif %} {% endif %} {% if neighbor.peergroup is defined and neighbor.peergroup %} {% if neighbor.peergroup_state is defined and neighbor.peergroup_state == "absent" %} - no inherit template {{ neighbor.peergroup }} + {{ indent_space }}no inherit template {{ neighbor.peergroup }} {% else %} - inherit template {{ neighbor.peergroup }} + {{ indent_space }}inherit template {{ neighbor.peergroup }} {% endif %} {% endif %} {% endif %} @@ -471,28 +324,28 @@ router bgp {{ bgp_vars.asn }} {% if neighbor.interface is defined and neighbor.interface %} {% set tag_or_ip = neighbor.interface %} {% if neighbor.state is defined and neighbor.state == "absent" %} - no neighbor interface {{ neighbor.interface }} + {{ indent_space }}no neighbor interface {{ neighbor.interface }} {% else %} - neighbor interface {{ neighbor.interface }} + {{ indent_space }}neighbor interface {{ neighbor.interface }} {% if neighbor.description is defined %} {% if neighbor.description %} - description "{{ neighbor.description }}" + {{ indent_space }}description "{{ neighbor.description }}" {% else %} - no description + {{ indent_space }}no description {% endif %} {% endif %} {% if neighbor.admin is defined %} {% if neighbor.admin == "up" %} - no shutdown + {{ indent_space }}no shutdown {% else %} - shutdown + {{ indent_space }}shutdown {% endif %} {% endif %} {% if neighbor.peergroup is defined and neighbor.peergroup %} {% if neighbor.peergroup_state is defined and neighbor.peergroup_state == "absent" %} - no inherit template {{ neighbor.peergroup }} + {{ indent_space }}no inherit template {{ neighbor.peergroup }} {% elif neighbor.peergroup_type is defined %} - inherit template {{ neighbor.peergroup }} inherit-type {{ neighbor.peergroup_type }} + {{ indent_space }}inherit template {{ neighbor.peergroup }} inherit-type {{ neighbor.peergroup_type }} {% endif %} {% endif %} {% endif %} @@ -500,35 +353,35 @@ router bgp {{ bgp_vars.asn }} {% if neighbor.auto_peer is defined and neighbor.auto_peer %} {% set tag_or_ip = neighbor.auto_peer %} {% if neighbor.state is defined and neighbor.state == "absent" %} - no neighbor {{ neighbor.auto_peer }} + {{ indent_space }}no neighbor {{ neighbor.auto_peer }} {% else %} - neighbor {{ neighbor.auto_peer }} + {{ indent_space }}neighbor {{ neighbor.auto_peer }} {% if neighbor.description is defined %} {% if neighbor.description %} - description "{{ neighbor.description }}" + {{ indent_space }}description "{{ neighbor.description }}" {% else %} - no description + {{ indent_space }}no description {% endif %} {% endif %} {% if neighbor.admin is defined %} {% if neighbor.admin == "up" %} - no shutdown + {{ indent_space }}no shutdown {% else %} - shutdown + {{ indent_space }}shutdown {% endif %} {% endif %} {% if neighbor.ebgp_peergroup is defined and neighbor.ebgp_peergroup %} {% if neighbor.ebgp_peergroup_state is defined and neighbor.ebgp_peergroup_state == "absent" %} - no inherit ebgp-template {{ neighbor.ebgp_peergroup }} + {{ indent_space }}no inherit ebgp-template {{ neighbor.ebgp_peergroup }} {% else %} - inherit ebgp-template {{ neighbor.ebgp_peergroup }} + {{ indent_space }}inherit ebgp-template {{ neighbor.ebgp_peergroup }} {% endif %} {% endif %} {% if neighbor.ibgp_peergroup is defined and neighbor.ibgp_peergroup %} {% if neighbor.ibgp_peergroup_state is defined and neighbor.ibgp_peergroup_state == "absent" %} - no inherit ibgp-template {{ neighbor.ibgp_peergroup }} + {{ indent_space }}no inherit ibgp-template {{ neighbor.ibgp_peergroup }} {% else %} - inherit ibgp-template {{ neighbor.ibgp_peergroup }} + {{ indent_space }}inherit ibgp-template {{ neighbor.ibgp_peergroup }} {% endif %} {% endif %} {% endif %} @@ -537,20 +390,32 @@ router bgp {{ bgp_vars.asn }} {% if neighbor.name is defined and neighbor.name %} {% set tag_or_ip = neighbor.name %} {% if neighbor.state is defined and neighbor.state == "absent" %} - no template {{ tag_or_ip }} + {{ indent_space }}no template {{ tag_or_ip }} {% else %} - template {{ tag_or_ip }} - {% if neighbor.subnet is defined and neighbor.subnet %} - {% if neighbor.subnet_state is defined and neighbor.subnet_state =="absent" %} - no listen {{ neighbor.subnet }} + {{ indent_space }}template {{ tag_or_ip }} + {% if neighbor.description is defined %} + {% if neighbor.description %} + {{ indent_space }}description "{{ neighbor.description }}" {% else %} - {% if neighbor.limit is defined and neighbor.limit %} - listen {{ neighbor.subnet }} limit {{ neighbor.limit }} - {% else %} - listen {{ neighbor.subnet }} + {{ indent_space }}no description + {% endif %} + {% endif %} + {% if neighbor.listen is defined and neighbor.listen %} + {% for item in neighbor.listen %} + {% if item.subnet is defined and item.subnet %} + {% if item.subnet_state is defined and item.subnet_state =="absent" %} + {{ indent_space }}no listen {{ item.subnet }} + {% else %} + {% set listen_str = item.subnet %} + {% if item.limit is defined and item.limit %} + {% set listen_str = listen_str ~ " limit " ~ item.limit %} {% endif %} + {{ indent_space }}listen {{ listen_str }} {% endif %} + {% endif %} + {% endfor %} {% endif %} + {% endif %} {% endif %} {% endif %} @@ -558,62 +423,61 @@ router bgp {{ bgp_vars.asn }} {% if (neighbor.state is defined and not neighbor.state == "absent" ) or neighbor.state is not defined %} {% if neighbor.remote_asn is defined and neighbor.remote_asn %} {% if neighbor.remote_asn_state is defined and neighbor.remote_asn_state == "absent" %} - no remote-as {{ neighbor.remote_asn }} + {{ indent_space }}no remote-as {{ neighbor.remote_asn }} {% else %} - remote-as {{ neighbor.remote_asn }} + {{ indent_space }}remote-as {{ neighbor.remote_asn }} {% endif %} {% endif %} {% if neighbor.local_as is defined %} {% if neighbor.local_as %} - local-as {{ neighbor.local_as }} + {{ indent_space }}local-as {{ neighbor.local_as }} {% else %} - no local-as + {{ indent_space }}no local-as {% endif %} {% endif %} {% if neighbor.weight is defined %} {% if neighbor.weight %} - weight {{ neighbor.weight }} + {{ indent_space }}weight {{ neighbor.weight }} {% else %} - no weight + {{ indent_space }}no weight {% endif %} {% endif %} - {% if neighbor.src_loopback is defined %} {% if neighbor.src_loopback|int(-1) != -1 %} - update-source loopback{{ neighbor.src_loopback }} + {{ indent_space }}update-source loopback{{ neighbor.src_loopback }} {% else %} - no update-source loopback + {{ indent_space }}no update-source loopback {% endif %} {% endif %} {% if neighbor.ebgp_multihop is defined %} {% if neighbor.ebgp_multihop %} - ebgp-multihop {{ neighbor.ebgp_multihop }} + {{ indent_space }}ebgp-multihop {{ neighbor.ebgp_multihop }} {% else %} - no ebgp-multihop + {{ indent_space }}no ebgp-multihop {% endif %} {% endif %} {% if neighbor.route_reflector_client is defined %} {% if neighbor.route_reflector_client %} - route-reflector-client + {{ indent_space }}route-reflector-client {% else %} - no route-reflector-client + {{ indent_space }}no route-reflector-client {% endif %} {% endif %} {% if neighbor.password is defined %} {% if neighbor.password %} - password {{ neighbor.password }} + {{ indent_space }}password {{ neighbor.password }} {% else %} - no password a + {{ indent_space }}no password a {% endif %} {% endif %} {% if neighbor.send_community is defined and neighbor.send_community %} {% for comm in neighbor.send_community %} {% if comm.type is defined and comm.type %} {% if comm.state is defined and comm.state == "absent" %} - no send-community {{ comm.type }} + {{ indent_space }}no send-community {{ comm.type }} {% else %} - send-community {{ comm.type }} + {{ indent_space }}send-community {{ comm.type }} {% endif %} {% endif %} {% endfor %} @@ -623,35 +487,35 @@ router bgp {{ bgp_vars.asn }} {% if af.type is defined and af.type %} {% if af.state is defined and af.state == "absent" %} {% if af.type == "l2vpn" %} - no address-family {{ af.type }} evpn + {{ indent_space }}no address-family {{ af.type }} evpn {% else %} - no address-family {{ af.type }} unicast + {{ indent_space }}no address-family {{ af.type }} unicast {% endif %} {% else %} {% if af.type == "l2vpn" %} - address-family {{ af.type }} evpn + {{ indent_space }}address-family {{ af.type }} evpn {% else %} - address-family {{ af.type }} unicast + {{ indent_space }}address-family {{ af.type }} unicast {% endif %} {% if af.activate is defined %} {% if af.activate %} - activate + {{ indent_space }}activate {% else %} - no activate + {{ indent_space }}no activate {% endif %} {% endif %} {% if af.sender_loop_detect is defined %} {% if af.sender_loop_detect %} - sender-side-loop-detection + {{ indent_space }}sender-side-loop-detection {% else %} - no sender-side-loop-detection + {{ indent_space }}no sender-side-loop-detection {% endif %} {% endif %} {% if af.allow_as_in is defined %} {% if af.allow_as_in %} - allowas-in {{ af.allow_as_in }} + {{ indent_space }}allowas-in {{ af.allow_as_in }} {% else %} - no allowas-in + {{ indent_space }}no allowas-in {% endif %} {% endif %} {% if af.route_map is defined and af.route_map %} @@ -659,9 +523,9 @@ router bgp {{ bgp_vars.asn }} {% if item.name is defined and item.name %} {% if item.filter is defined and item.filter %} {% if item.state is defined and item.state == "absent" %} - no route-map {{ item.name }} {{ item.filter }} + {{ indent_space }}no route-map {{ item.name }} {{ item.filter }} {% else %} - route-map {{ item.name }} {{ item.filter }} + {{ indent_space }}route-map {{ item.name }} {{ item.filter }} {% endif%} {% endif %} {% endif %} @@ -669,24 +533,67 @@ router bgp {{ bgp_vars.asn }} {% endif %} {% if af.next_hop_self is defined %} {% if af.next_hop_self %} - next-hop-self + {{ indent_space }}next-hop-self {% else %} - no next-hop-self + {{ indent_space }}no next-hop-self {% endif %} {% endif %} {% if af.soft_reconf is defined %} {% if af.soft_reconf %} - soft-reconfiguration inbound + {{ indent_space }}soft-reconfiguration inbound {% else %} - no soft-reconfiguration inbound + {{ indent_space }}no soft-reconfiguration inbound {% endif %} {% endif %} {% if af.add_path is defined %} {% if af.add_path %} - add-path {{ af.add_path }} + {{ indent_space }}add-path {{ af.add_path }} + {% else %} + {{ indent_space }}no add-path + {% endif %} + {% endif %} + {% if af.max_prefix is defined %} + {% if af.max_prefix.count is defined and af.max_prefix.count %} + {% if af.max_prefix.state is defined and af.max_prefix.state == "absent" %} + {{ indent_space }}no maximum-prefix {{ af.max_prefix.count }} + {% else %} + {% set max_pfrx_str = af.max_prefix.count %} + {% if af.max_prefix.threshold is defined and af.max_prefix.threshold %} + {% set max_pfrx_str = max_pfrx_str ~ " " ~ af.max_prefix.threshold %} + {% endif %} + {% if af.max_prefix.warning is defined and af.max_prefix.warning %} + {% set max_pfrx_str = max_pfrx_str ~ " warning-only" %} + {% endif %} + {{ indent_space }}maximum-prefix {{ max_pfrx_str }} + {% endif %} + {% endif %} + {% endif %} + {% if af.default_originate is defined %} + {% if af.default_originate.state is defined and af.default_originate.state == "absent" %} + {{ indent_space }}no default-originate + {% else %} + {% set def_origin_str = " " %} + {% if af.default_originate.route_map is defined and af.default_originate.route_map %} + {% set def_origin_str = "route-map " ~ af.default_originate.route_map %} + {% endif %} + {{ indent_space }}default-originate {{ def_origin_str }} + {% endif %} + {% endif %} + {% if af.distribute_list is defined and af.distribute_list %} + {% if af.distribute_list.in is defined and af.distribute_list.in %} + {% if af.distribute_list.in_state is defined and af.distribute_list.in_state == "absent" %} + {{ indent_space }}no distribute-list {{ af.distribute_list.in }} in + {% else %} + {{ indent_space }}distribute-list {{ af.distribute_list.in }} in + {% endif %} + {% endif %} + {% if af.distribute_list.out is defined and af.distribute_list.out %} + {% if af.distribute_list.out_state is defined and af.distribute_list.out_state == "absent" %} + {{ indent_space }}no distribute-list {{ af.distribute_list.out }} out {% else %} - no add-path + {{ indent_space }}distribute-list {{ af.distribute_list.out }} out {% endif %} + {% endif %} {% endif %} @@ -696,58 +603,77 @@ router bgp {{ bgp_vars.asn }} {% endif %} {% if neighbor.adv_interval is defined %} {% if neighbor.adv_interval %} - advertisement-interval {{ neighbor.adv_interval }} + {{ indent_space }}advertisement-interval {{ neighbor.adv_interval }} + {% else %} + {{ indent_space }}no advertisement-interval + {% endif %} + {% endif %} + {% if neighbor.adv_start is defined and neighbor.adv_start >= 0 %} + {% if neighbor.adv_start_state is defined and neighbor.adv_start_state == "absent" %} + {{ indent_space }}no advertisement-start + {% else %} + {{ indent_space }}advertisement-start {{ neighbor.adv_start }} + {% endif %} + {% endif %} + {% if neighbor.conn_retry_timer is defined %} + {% if neighbor.conn_retry_timer %} + {{ indent_space }}connection-retry-timer {{ neighbor.conn_retry_timer }} {% else %} - no advertisement-interval + {{ indent_space }}no connection-retry-timer {% endif %} {% endif %} + {% if neighbor.remove_pri_as is defined and neighbor.remove_pri_as == "present" %} + {{ indent_space }}remove-private-as + {% elif neighbor.remove_pri_as is defined and neighbor.remove_pri_as == "absent" %} + {{ indent_space }}no remove-private-as + {% endif %} {% if neighbor.fall_over is defined and neighbor.fall_over == "present" %} - fall-over + {{ indent_space }}fall-over {% elif neighbor.fall_over is defined and neighbor.fall_over == "absent" %} - no fall-over + {{ indent_space }}no fall-over {% endif %} {% if neighbor.bfd is defined and neighbor.bfd %} - bfd + {{ indent_space }}bfd {% elif neighbor.bfd is defined and not neighbor.bfd %} - no bfd + {{ indent_space }}no bfd {% endif %} {% if neighbor.timer is defined %} {% if neighbor.timer %} - timers {{ neighbor.timer }} + {{ indent_space }}timers {{ neighbor.timer }} {% else %} - no timers + {{ indent_space }}no timers {% endif %} {% endif %} {% if neighbor.admin is defined %} {% if neighbor.admin == "up" %} - no shutdown + {{ indent_space }}no shutdown {% else %} - shutdown + {{ indent_space }}shutdown {% endif %} {% endif %} {% if neighbor.distribute_list is defined and neighbor.distribute_list %} - address-family ipv4 unicast + {{ indent_space }}address-family ipv4 unicast {% if neighbor.distribute_list.in is defined and neighbor.distribute_list.in %} {% if neighbor.distribute_list.in_state is defined and neighbor.distribute_list.in_state == "absent" %} - no distribute-list {{ neighbor.distribute_list.in }} in + {{ indent_space }}no distribute-list {{ neighbor.distribute_list.in }} in {% else %} - distribute-list {{ neighbor.distribute_list.in }} in + {{ indent_space }}distribute-list {{ neighbor.distribute_list.in }} in {% endif %} {% endif %} {% if neighbor.distribute_list.out is defined and neighbor.distribute_list.out %} {% if neighbor.distribute_list.out_state is defined and neighbor.distribute_list.out_state == "absent" %} - no distribute-list {{ neighbor.distribute_list.out }} out + {{ indent_space }}no distribute-list {{ neighbor.distribute_list.out }} out {% else %} - distribute-list {{ neighbor.distribute_list.out }} out + {{ indent_space }}distribute-list {{ neighbor.distribute_list.out }} out {% endif %} {% endif %} {% endif %} {% if neighbor.sender_loop_detect is defined %} - address-family ipv4 unicast + {{ indent_space }}address-family ipv4 unicast {% if neighbor.sender_loop_detect %} - sender-side-loop-detection + {{ indent_space }}sender-side-loop-detection {% else %} - no sender-side-loop-detection + {{ indent_space }}no sender-side-loop-detection {% endif %} {% endif %} @@ -755,78 +681,564 @@ router bgp {{ bgp_vars.asn }} {% endif %} {% endif %} {% endfor %} - {% if bgp_vars.vrf is defined %} - vrf {{ bgp_vars.vrf.name }} + {% endif %} +{% endmacro %} + +{% macro render_ibgp_redist_internal_configs(af_vars) %} + {% if af_vars.ibgp_redist_internal is defined and af_vars.ibgp_redist_internal%} + {% if af_vars.ibgp_redist_internal.state is defined and af_vars.ibgp_redist_internal.state == "absent" %} + no bgp redistribute-internal + {% else %} + bgp redistribute-internal + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_distance_bgp_configs(af_vars) %} + {% if af_vars.distance_bgp is defined and af_vars.distance_bgp %} + {% if af_vars.distance_bgp.state is defined and af_vars.distance_bgp.state == "absent" %} + no distance bgp + {% else %} + {% if af_vars.distance_bgp.value is defined and af_vars.distance_bgp.value %} + distance bgp {{ af_vars.distance_bgp.value }} + {% endif %} + {% endif %} + {% endif %} +{% endmacro %} + + +{% macro render_dampening_configs(af_vars) %} + {% if af_vars.dampening is defined and af_vars.dampening %} + {% if af_vars.dampening.state is defined and af_vars.dampening.state == "absent" %} + no dampening + {% else %} + {% if af_vars.dampening.value is defined and af_vars.dampening.value %} + {% if af_vars.dampening.route_map is defined and af_vars.dampening.route_map %} + dampening {{ af_vars.dampening.value }} route-map {{ af_vars.dampening.route_map }} + {% else %} + dampening {{ af_vars.dampening.value }} + {% endif %} + {% else %} + {% if af_vars.dampening.route_map is defined and af_vars.dampening.route_map %} + dampening 15 750 2000 60 route-map {{ af_vars.dampening.route_map }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} +{% endmacro %} - {% if bgp_vars.vrf.address_family is defined and bgp_vars.vrf.state is defined and bgp_vars.vrf.state == "absent" %} - no address-family {{ bgp_vars.vrf.address_family.type }} unicast - no address-family {{ bgp_vars.vrf.address_type }} unicast +{% macro render_af_configs(af_vars) %} + {% if af_vars is defined and af_vars %} + {% if af_vars.aggregate_address is defined and af_vars.aggregate_address %} + {% for addr in af_vars.aggregate_address %} + {% if addr.ip_and_mask is defined and addr.ip_and_mask %} + {% if addr.state is defined and addr.state == "absent" %} + no aggregate-address {{ addr.ip_and_mask }} + {% else %} + {% set aggr_str = addr.ip_and_mask %} + {% if addr.adv_map is defined and addr.adv_map %} + {% set aggr_str = aggr_str ~ " advertise-map " ~ addr.adv_map %} + {% endif %} + {% if addr.as_set is defined and addr.as_set %} + {% set aggr_str = aggr_str ~ " as-set " %} + {% endif %} + {% if addr.attr_map is defined and addr.attr_map %} + {% set aggr_str = aggr_str ~ " attribute-map " ~ addr.attr_map %} + {% endif %} + {% if addr.summary is defined and addr.summary %} + {% set aggr_str = aggr_str ~ " summary-only" %} + {% endif %} + {% if addr.suppress_map is defined and addr.suppress_map %} + {% set aggr_str = aggr_str ~ " suppress-map " ~ addr.suppress_map %} + {% endif %} + aggregate-address {{ aggr_str }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_rtid_configs(routerid_vars) %} + {% if routerid_vars %} + router-id {{ routerid_vars }} {% else %} - address-family {{ bgp_vars.vrf.address_family.type }} unicast + no router-id {% endif %} - {% if bgp_vars.vrf.router_id is defined %} - router-id {{ bgp_vars.vrf.router_id }} +{% endmacro %} + +{% macro render_bfd_all_neigh_configs(bfd_all_neigh_vars) %} + {% if bfd_all_neigh_vars.state is defined and bfd_all_neigh_vars.state == "absent"%} + no bfd all-neighbors + {% else %} + {% set bfd_vars = bfd_all_neigh_vars %} + {% if bfd_vars.interval is defined and bfd_vars.min_rx is defined and bfd_vars.multiplier is defined %} + bfd all-neighbors interval {{ bfd_vars.interval }} min_rx {{ bfd_vars.min_rx }} multiplier {{ bfd_vars.multiplier }} role {{ bfd_vars.role }} + {% else %} + bfd all-neighbors {% endif %} - {% if bgp_vars.vrf.address_family.redistribute is defined %} - {% for route in bgp_vars.vrf.address_family.redistribute %} - {% if route.route_type is defined %} + {% endif %} +{% endmacro %} + +{% macro render_log_neigh_change_configs(log_neigh_change_vars) %} + {% if log_neigh_change_vars %} + log-neighbor-changes + {% else %} + no log-neighbor-changes + {% endif %} +{% endmacro %} + +{% macro render_maxpath_ebgp_configs(maxpath_ebgp_vars) %} + {% if maxpath_ebgp_vars %} + maximum-paths ebgp {{ maxpath_ebgp_vars }} + {% else %} + no maximum-paths ebgp + {% endif %} +{% endmacro %} + +{% macro render_maxpath_ibgp_configs(maxpath_ibgp_vars) %} + {% if maxpath_ibgp_vars %} + maximum-paths ibgp {{ maxpath_ibgp_vars }} + {% else %} + no maximum-paths ibgp + {% endif %} +{% endmacro %} + +{% macro render_graceful_restart_configs(graceful_restart_vars) %} + {% if graceful_restart_vars %} + graceful-restart role receiver-only + {% else %} + no graceful-restart role receiver-only + {% endif %} +{% endmacro %} + +{% macro render_always_compare_med_configs(always_compare_med_vars) %} + {% if always_compare_med_vars %} + always-compare-med + {% else %} + no always-compare-med + {% endif %} +{% endmacro %} + +{% macro render_default_loc_pref_configs(default_loc_pref_vars) %} + {% if default_loc_pref_vars %} + default local-preference {{ default_loc_pref_vars }} + {% else %} + no default local-preference + {% endif %} +{% endmacro %} + +{% macro render_fast_ext_fallover_configs(fast_ext_fallover_vars) %} + {% if fast_ext_fallover_vars %} + fast-external-fallover + {% else %} + no fast-external-fallover + {% endif %} +{% endmacro %} + +{% macro render_confederation_configs(confederation_vars) %} + {% if confederation_vars.identifier is defined %} + {% if confederation_vars.identifier %} + confederation identifier {{ confederation_vars.identifier }} + {% else %} + no confederation identifier 1 + {% endif %} + {% endif %} + {% if confederation_vars.peers is defined and confederation_vars.peers %} + {% if confederation_vars.peers_state is defined and confederation_vars.peers_state == "absent" %} + no confederation peers {{ confederation_vars.peers }} + {% else %} + confederation peers {{ confederation_vars.peers }} + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_route_reflector_client_configs(route_reflector_vars) %} + {% if route_reflector_vars.client_to_client is defined %} + {% if route_reflector_vars.client_to_client %} + client-to-client reflection + {% else %} + no client-to-client reflection + {% endif %} + {% endif %} +{% endmacro %} +{% macro render_route_reflector_cluster_configs(route_reflector_vars) %} + {% if route_reflector_vars.cluster_id is defined %} + {% if route_reflector_vars.cluster_id %} + cluster-id {{ route_reflector_vars.cluster_id }} + {% else %} + no cluster-id 1 + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_best_path_as_configs(best_path_vars) %} + {% if best_path_vars.as_path is defined and best_path_vars.as_path %} + {% if best_path_vars.as_path_state is defined and best_path_vars.as_path_state == "absent" %} + no bestpath as-path {{ best_path_vars.as_path }} + {% else %} + bestpath as-path {{ best_path_vars.as_path }} + {% endif %} + {% endif %} +{% endmacro %} +{% macro render_best_path_routerid_configs(best_path_vars) %} + {% if best_path_vars.ignore_router_id is defined %} + {% if best_path_vars.ignore_router_id %} + bestpath router-id ignore + {% else %} + no bestpath router-id ignore + {% endif %} + {% endif %} +{% endmacro %} +{% macro render_best_path_med_configs(best_path_vars,indent_space) %} + {% if best_path_vars.med is defined and best_path_vars.med %} + {% for med in best_path_vars.med %} + {% if med.attribute is defined and med.attribute %} + {% if med.state is defined and med.state == "absent" %} + {{ indent_space }}no bestpath med {{ med.attribute }} + {% else %} + {{ indent_space }}bestpath med {{ med.attribute }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endmacro %} + +{% macro render_ipv4_network_configs(ipv4_network_vars) %} + {% for net in ipv4_network_vars %} + {% if net.address is defined and net.address %} + {% if net.state is defined and net.state == "absent"%} + no network {{ net.address }} + {% else %} + network {{ net.address }} + {% endif %} + {% endif %} + {% endfor %} +{% endmacro %} + +{% macro render_ipv6_network_configs(ipv6_network_vars) %} + {% for net in ipv6_network_vars %} + {% if net.address is defined and net.address %} + {% if net.state is defined and net.state == "absent"%} + no network {{ net.address }} + {% else %} + network {{ net.address }} + {% endif %} + {% endif %} + {% endfor %} +{% endmacro %} + +{% macro render_redistribute_configs(redistribute_vars,indent_space) %} + {% for route in redistribute_vars %} + {% if route.route_type is defined and route.route_type %} + {% if route.address_type is defined and route.address_type %} + {{ indent_space }}address-family {{ route.address_type }} unicast {% if route.state is defined and route.state == "absent" %} {% if route.route_type == "imported_bgp" %} - no redistribute imported-bgp-routes vrf {{ route.imported_bgp_vrf_name }} + {% set redist_str = "imported-bgp-routes vrf " ~ route.imported_bgp_vrf_name %} + {% elif route.route_type == "ospf" and route.ospf_id %} + {% set redist_str = route.route_type ~ " " ~ route.ospf_id %} + {% elif route.route_type == "l2vpn" %} + {% set redist_str = route.route_type ~ " evpn" %} {% else %} - no redistribute {{ route.route_type }} + {% set redist_str = route.route_type %} {% endif %} + {{ indent_space }}no redistribute {{ redist_str }} {% else %} {% if route.route_map_name is defined and route.route_map_name %} - {% if route.route_type == "ospf" and route.ospf_id %} - redistribute {{ route.route_type }} route.ospf_id route-map {{ route.route_map_name }} - {% elif route.route_type == "imported_bgp" %} - redistribute imported-bgp-routes vrf {{ route.imported_bgp_vrf_name }} route-map {{ route.route_map_name }} + {% if route.route_type == "imported_bgp" %} + {% set redist_str = "imported-bgp-routes vrf " ~ route.imported_bgp_vrf_name ~ " route-map " ~ route.route_map_name %} + {% elif route.route_type == "ospf" and route.ospf_id %} + {% set redist_str = route.route_type ~ " " ~ route.ospf_id ~ " route-map " ~ route.route_map_name %} {% elif route.route_type == "l2vpn" %} - redistribute {{ route.route_type }} evpn route-map {{ route.route_map_name }} + {% set redist_str = route.route_type ~ " evpn route-map " ~ route.route_map_name %} {% else %} - redistribute {{ route.route_type }} route-map {{ route.route_map_name }} + {% set redist_str = route.route_type ~ " route-map " ~ route.route_map_name %} {% endif %} + {{ indent_space }}redistribute {{ redist_str }} {% else %} - {% if route.route_type == "ospf" and route.ospf_id %} - redistribute {{ route.route_type }} route.ospf_id - {% elif route.route_type == "imported_bgp" %} - redistribute imported-bgp-routes vrf {{ route.imported_bgp_vrf_name }} + {% if route.route_type == "imported_bgp" %} + {% set redist_str = "imported-bgp-routes vrf " ~ route.imported_bgp_vrf_name %} + {% elif route.route_type == "ospf" and route.ospf_id %} + {% set redist_str = route.route_type ~ " " ~ route.ospf_id %} {% elif route.route_type == "l2vpn" %} - redistribute {{ route.route_type }} evpn + {% set redist_str = route.route_type ~ " evpn" %} {% else %} - redistribute {{ route.route_type }} + {% set redist_str = route.route_type %} {% endif %} + {{ indent_space }}redistribute {{ redist_str }} {% endif %} {% endif %} {% endif %} - {% endfor %} - {% endif %} - {% if bgp_vars.vrf.neighbor is defined %} - {% for ngbr in bgp_vars.vrf.neighbor %} - {% if ngbr.interface is defined %} - neighbor interface {{ ngbr.interface }} - {% else %} - {% if ngbr.ip is defined %} - neighbor {{ ngbr.ip }} - {% endif %} - {% endif %} - {% if ngbr.remote_asn is defined %} - remote-as {{ ngbr.remote_asn }} - {% endif %} - {% if ngbr.admin is defined %} - {%if ngbr.admin == "up" %} - no shutdown - {% else %} - shutdown - {% endif %} - {% endif %} - {% endfor %} - {% endif %} + {% endif %} + {% endfor %} +{% endmacro %} + +{% if os10_bgp is defined and os10_bgp %} +{% set bgp_vars = os10_bgp %} +{% if bgp_vars.state is defined and bgp_vars.state == "absent" %} +no router bgp +{% else %} + {# Add Feature to the switch #} + {% if bgp_vars.asn is defined and bgp_vars.asn %} +router bgp {{ bgp_vars.asn }} + {% set indent_space = "" %} + {% if bgp_vars.router_id is defined %} + {% set routerid_vars = bgp_vars.router_id %} +{{ render_rtid_configs(routerid_vars) }} {% endif %} - {% endif %} + {% if bgp_vars.as_notation is defined %} + {% set as_vars = bgp_vars.as_notation %} +{{ render_as_notation_configs(as_vars) }} + {% endif %} + + {% if bgp_vars.enforce_first_as is defined %} + {% set enforce_first_as_vars = bgp_vars.enforce_first_as %} +{{ render_enforce_first_as_configs(enforce_first_as_vars) }} + {% endif %} + + {% if bgp_vars.non_deterministic_med is defined %} + {% set non_deter_med_vars = bgp_vars.non_deterministic_med %} +{{ render_non_deterministic_med_configs(non_deter_med_vars) }} + {% endif %} + + {% if bgp_vars.outbound_optimization is defined %} + {% set out_opt_vars = bgp_vars.outbound_optimization %} +{{ render_outbound_optimization_configs(out_opt_vars) }} + {% endif %} + {% if bgp_vars.bfd_all_neighbors is defined and bgp_vars.bfd_all_neighbors is defined %} + {% set bfd_all_neigh_vars = bgp_vars.bfd_all_neighbors %} +{{ render_bfd_all_neigh_configs(bfd_all_neigh_vars) }} + {% endif %} + + {% if bgp_vars.log_neighbor_changes is defined %} + {% set log_neigh_change_vars = bgp_vars.log_neighbor_changes %} +{{ render_log_neigh_change_configs(log_neigh_change_vars) }} + {% endif %} + + {% if bgp_vars.maxpath_ebgp is defined %} + {% set maxpath_ebgp_vars = bgp_vars.maxpath_ebgp %} +{{ render_maxpath_ebgp_configs(maxpath_ebgp_vars) }} + {% endif %} + + {% if bgp_vars.maxpath_ibgp is defined %} + {% set maxpath_ibgp_vars = bgp_vars.maxpath_ibgp %} +{{ render_maxpath_ibgp_configs(maxpath_ibgp_vars) }} + {% endif %} + + {% if bgp_vars.graceful_restart is defined %} + {% set graceful_restart_vars = bgp_vars.graceful_restart %} +{{ render_graceful_restart_configs(graceful_restart_vars) }} + {% endif %} + + {% if bgp_vars.always_compare_med is defined %} + {% set always_compare_med_vars = bgp_vars.always_compare_med %} +{{ render_always_compare_med_configs(always_compare_med_vars) }} + {% endif %} + + {% if bgp_vars.default_loc_pref is defined %} + {% set default_loc_pref_vars = bgp_vars.default_loc_pref %} +{{ render_default_loc_pref_configs(default_loc_pref_vars) }} + {% endif %} + + {% if bgp_vars.fast_ext_fallover is defined %} + {% set fast_ext_fallover_vars = bgp_vars.fast_ext_fallover %} +{{ render_fast_ext_fallover_configs(fast_ext_fallover_vars) }} + {% endif %} + + {% if bgp_vars.confederation is defined and bgp_vars.confederation %} + {% set confederation_vars = bgp_vars.confederation %} +{{ render_confederation_configs(confederation_vars) }} + {% endif %} + + {% if bgp_vars.route_reflector is defined and bgp_vars.route_reflector %} + {% set route_reflector_vars = bgp_vars.route_reflector %} +{{ render_route_reflector_client_configs(route_reflector_vars) }} +{{ render_route_reflector_cluster_configs(route_reflector_vars) }} + {% endif %} + + {% if bgp_vars.best_path is defined and bgp_vars.best_path %} + {% set best_path_vars = bgp_vars.best_path %} +{{ render_best_path_as_configs(best_path_vars) }} +{{ render_best_path_routerid_configs(best_path_vars) }} +{{ render_best_path_med_configs(best_path_vars,indent_space) }} + {% endif %} + + {% if bgp_vars.address_family_ipv4 is defined and bgp_vars.address_family_ipv4 %} + {% set af_vars = bgp_vars.address_family_ipv4 %} + address-family ipv4 unicast +{{ render_af_configs(af_vars) }} +{{ render_ibgp_redist_internal_configs(af_vars) }} +{{ render_dampening_configs(af_vars) }} +{{ render_default_metric_configs(af_vars) }} +{{ render_distance_bgp_configs(af_vars) }} + {% endif %} + + {% if bgp_vars.address_family_ipv6 is defined and bgp_vars.address_family_ipv6 %} + {% set af_vars = bgp_vars.address_family_ipv6 %} + address-family ipv6 unicast +{{ render_af_configs(af_vars) }} +{{ render_ibgp_redist_internal_configs(af_vars) }} +{{ render_dampening_configs(af_vars) }} +{{ render_default_metric_configs(af_vars) }} +{{ render_distance_bgp_configs(af_vars) }} + {% endif %} + + {% if bgp_vars.ipv4_network is defined and bgp_vars.ipv4_network %} + {% set ipv4_network_vars = bgp_vars.ipv4_network %} + address-family ipv4 unicast +{{ render_ipv4_network_configs(ipv4_network_vars) }} + {% endif %} + + {% if bgp_vars.ipv6_network is defined and bgp_vars.ipv6_network %} + {% set ipv6_network_vars = bgp_vars.ipv6_network %} + address-family ipv6 unicast +{{ render_ipv6_network_configs(ipv6_network_vars) }} + {% endif %} + + {% if bgp_vars.redistribute is defined and bgp_vars.redistribute %} + {% set redistribute_vars = bgp_vars.redistribute %} +{{ render_redistribute_configs(redistribute_vars,indent_space) }} + {% endif %} + + {% if bgp_vars.neighbor is defined and bgp_vars.neighbor %} + {% set neigh_vars = bgp_vars.neighbor %} +{{ render_neigh_configs(neigh_vars,indent_space) }} + {% endif %} + + {% if bgp_vars.vrfs is defined %} + {% set indent_space = " " %} + {% for vrf in bgp_vars.vrfs %} + {% if vrf.state is defined and vrf.state == "absent" %} + no vrf {{ vrf.name }} + {% else %} + vrf {{ vrf.name }} + + {% if vrf.router_id is defined %} + {% set routerid_vars = vrf.router_id %} + {{ render_rtid_configs(routerid_vars) }} + {% endif %} + + {% if vrf.as_notation is defined %} + {% set as_vars = vrf.as_notation %} + {{ render_as_notation_configs(as_vars) }} + {% endif %} + + {% if vrf.enforce_first_as is defined %} + {% set enforce_first_as_vars = vrf.enforce_first_as %} + {{ render_enforce_first_as_configs(enforce_first_as_vars) }} + {% endif %} + + {% if vrf.non_deterministic_med is defined %} + {% set non_deter_med_vars = vrf.non_deterministic_med %} + {{ render_non_deterministic_med_configs(non_deter_med_vars) }} + {% endif %} + + {% if vrf.outbound_optimization is defined %} + {% set out_opt_vars = vrf.outbound_optimization %} + {{ render_outbound_optimization_configs(out_opt_vars) }} + {% endif %} + + {% if vrf.bfd_all_neighbors is defined and vrf.bfd_all_neighbors is defined %} + {% set bfd_all_neigh_vars = vrf.bfd_all_neighbors %} + {{ render_bfd_all_neigh_configs(bfd_all_neigh_vars) }} + {% endif %} + + {% if vrf.log_neighbor_changes is defined %} + {% set log_neigh_change_vars = vrf.log_neighbor_changes %} + {{ render_log_neigh_change_configs(log_neigh_change_vars) }} + {% endif %} + + {% if vrf.maxpath_ebgp is defined %} + {% set maxpath_ebgp_vars = vrf.maxpath_ebgp %} + {{ render_maxpath_ebgp_configs(maxpath_ebgp_vars) }} + {% endif %} + + {% if vrf.maxpath_ibgp is defined %} + {% set maxpath_ibgp_vars = vrf.maxpath_ibgp %} + {{ render_maxpath_ibgp_configs(maxpath_ibgp_vars) }} + {% endif %} + + {% if vrf.graceful_restart is defined %} + {% set graceful_restart_vars = vrf.graceful_restart %} + {{ render_graceful_restart_configs(graceful_restart_vars) }} + {% endif %} + + {% if vrf.always_compare_med is defined %} + {% set always_compare_med_vars = vrf.always_compare_med %} + {{ render_always_compare_med_configs(always_compare_med_vars) }} + {% endif %} + + {% if vrf.default_loc_pref is defined %} + {% set default_loc_pref_vars = vrf.default_loc_pref %} + {{ render_default_loc_pref_configs(default_loc_pref_vars) }} + {% endif %} + + {% if vrf.fast_ext_fallover is defined %} + {% set fast_ext_fallover_vars = vrf.fast_ext_fallover %} + {{ render_fast_ext_fallover_configs(fast_ext_fallover_vars) }} + {% endif %} + + {% if vrf.route_reflector is defined and vrf.route_reflector %} + {% set route_reflector_vars = vrf.route_reflector %} + {{ render_route_reflector_client_configs(route_reflector_vars) }} + {{ render_route_reflector_cluster_configs(route_reflector_vars) }} + {% endif %} + + {% if vrf.best_path is defined and vrf.best_path %} + {% set best_path_vars = vrf.best_path %} + {{ render_best_path_as_configs(best_path_vars) }} + {{ render_best_path_routerid_configs(best_path_vars) }} +{{ render_best_path_med_configs(best_path_vars,indent_space) }} + {% endif %} + + {% if vrf.address_family_ipv4 is defined and vrf.address_family_ipv4 %} + {% set af_vars = vrf.address_family_ipv4 %} + address-family ipv4 unicast + {{ render_af_configs(af_vars) }} + {{ render_dampening_configs(af_vars) }} + {{ render_ibgp_redist_internal_configs(af_vars) }} + {{ render_default_metric_configs(af_vars) }} + {{ render_distance_bgp_configs(af_vars) }} + {% endif %} + + {% if vrf.address_family_ipv6 is defined and vrf.address_family_ipv6 %} + {% set af_vars = vrf.address_family_ipv6 %} + address-family ipv6 unicast + {{ render_af_configs(af_vars) }} + {{ render_dampening_configs(af_vars) }} + {{ render_ibgp_redist_internal_configs(af_vars) }} + {{ render_default_metric_configs(af_vars) }} + {{ render_distance_bgp_configs(af_vars) }} + {% endif %} + + {% if vrf.ipv4_network is defined and vrf.ipv4_network %} + {% set ipv4_network_vars = vrf.ipv4_network %} + address-family ipv4 unicast + {{ render_ipv4_network_configs(ipv4_network_vars) }} + {% endif %} + + {% if vrf.ipv6_network is defined and vrf.ipv6_network %} + {% set ipv6_network_vars = vrf.ipv6_network %} + address-family ipv6 unicast + {{ render_ipv6_network_configs(ipv6_network_vars) }} + {% endif %} + + {% if vrf.redistribute is defined and vrf.redistribute %} + {% set redistribute_vars = vrf.redistribute %} +{{ render_redistribute_configs(redistribute_vars,indent_space) }} + {% endif %} + + {% if vrf.neighbor is defined and vrf.neighbor %} + {% set neigh_vars = vrf.neighbor %} +{{ render_neigh_configs(neigh_vars,indent_space) }} + {% endif %} + + {% endif %} + {% endfor %} + {% endif %} {% endif %} {% endif %} {% endif %} diff --git a/roles/os10_bgp/tests/main.os10.yaml b/roles/os10_bgp/tests/main.os10.yaml index 51f9209..e556186 100644 --- a/roles/os10_bgp/tests/main.os10.yaml +++ b/roles/os10_bgp/tests/main.os10.yaml @@ -5,6 +5,10 @@ os10_bgp: asn: 12 router_id: 90.1.1.4 + as_notation: asdot + enforce_first_as: false + non_deterministic_med: true + outbound_optimization: true maxpath_ibgp: 2 maxpath_ebgp: 2 graceful_restart: true @@ -27,11 +31,19 @@ os10_bgp: value: 15 750 2000 60 route_map: qq state: present + ibgp_redist_internal: + state: present + default_metric: 10 + distance_bgp: + value: 3 4 6 + state: present address_family_ipv6: aggregate_address: - ip_and_mask: 2001:4898:5808:ffa0::/126 state: present summary_only: true + ibgp_redist_internal: + state: present best_path: as_path: ignore as_path_state: present @@ -46,10 +58,32 @@ os10_bgp: - address: "2001:4898:5808:ffa0::/126" state: present neighbor: + - name: peer1 + type: peergroup + state: present - name: ebgp_pg type: peergroup bfd: yes state: present + address_family: + - type: ipv4 + activate: false + state: present + max_prefix: + count: 20 + threshold: 90 + warning: true + state: present + listen: + - subnet: 4.4.4.4/32 + limit: 4 + subnet_state: present + - subnet: 6.6.6.6/32 + limit: 3 + subnet_state: present + - subnet: 23::/64 + limit: + subnet_state: present - name: ibgp_pg type: peergroup weight: 10 @@ -76,11 +110,22 @@ os10_bgp: fall_over: present password: bgppassword route_reflector_client: true + adv_start: 100 + adv_start_state: present + conn_retry_timer: 20 + remove_pri_as: present src_loopback: 0 address_family: - type: ipv4 activate: true state: present + max_prefix: + count: 30 + threshold: 50 + state: present + default_originate: + route_map: aa + state: present send_community: - type: standard state: present @@ -144,17 +189,196 @@ os10_bgp: multiplier: 3 role: active state: present - vrf: - name: "GREEN" - address_family: - type: ipv4 - redistribute: - - route_type: l2vpn - address_type: ipv4 + vrfs: + - name: "test1" + router_id: 70.1.1.4 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: false + enforce_first_as: false + non_deterministic_med: true + outbound_optimization: true + fast_ext_fallover: false + always_compare_med: true + default_loc_pref: 1000 + route_reflector: + client_to_client: false + cluster_id: 2000 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + distance_bgp: + value: 3 4 6 + state: present + ibgp_redist_internal: + state: present + default_metric: 10 + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + - attribute: missing-as-worst + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" state: present - neighbor: - - type: ipv4 - ip: "172.16.1.1" - remote_asn: 65400 - admin: up + neighbor: + - name: peer1 + type: peergroup + description: "template peer1" + adv_interval: 50 + adv_start: 100 + adv_start_state: present + ebgp_multihop: 20 + fall_over: present + conn_retry_timer: 20 + remove_pri_as: present + bfd: yes + address_family: + - type: ipv4 + state: present + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan10 + send_community: + - type: extended + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.10.1 + name: peer1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + route_reflector_client: true + src_loopback: 0 + address_family: + - type: ipv4 + activate: false + distribute_list: + in: dd + in_state: present + out: dd + out_state: present + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: false + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + default_originate: + route_map: aa + state: present + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ebgp_peergroup: ebgp_pg + ebgp_peergroup_state: present + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + address_family: + - type: ipv4 + activate: false + sender_loop_detect: false + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + default_originate: + route_map: dd + state: present + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + - route_type: connected + route_map_name: bb + address_type: ipv4 + state: present + - route_type: l2vpn + route_map_name: cc + address_type: ipv4 + state: present + - route_type: imported_bgp + imported_bgp_vrf_name: test2 + route_map_name: dd + address_type: ipv4 + state: present + - route_type: ospf + ospf_id: 12 + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + as_notation: asdot + state: present + - name: "test2" + router_id: 80.1.1.4 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + as_notation: asdot + state: present state: present diff --git a/roles/os10_copy_config/README.md b/roles/os10_copy_config/README.md index e5e58a7..eadefec 100644 --- a/roles/os10_copy_config/README.md +++ b/roles/os10_copy_config/README.md @@ -3,7 +3,7 @@ Copy-config role This role is used to push the backup running configuration into a Dell EMC PowerSwitch platform running Dell EMC SmartFabric OS10, and merges the configuration in the template file with the running configuration of the device. -The copy-config role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The copy-config role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_dns/README.md b/roles/os10_dns/README.md index 023df32..b65d762 100644 --- a/roles/os10_dns/README.md +++ b/roles/os10_dns/README.md @@ -3,7 +3,7 @@ DNS role This role facilitates the configuration of the domain name service (DNS). This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The DNS role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The DNS role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_ecmp/README.md b/roles/os10_ecmp/README.md index 8582e04..6932fdf 100644 --- a/roles/os10_ecmp/README.md +++ b/roles/os10_ecmp/README.md @@ -3,7 +3,7 @@ ECMP role This role facilitates the configuration of equal cost multi-path (ECMP), and it supports the configuration of ECMP for IPv4. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The ECMP role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The ECMP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_fabric_summary/README.md b/roles/os10_fabric_summary/README.md index 12f491d..0ff99bf 100644 --- a/roles/os10_fabric_summary/README.md +++ b/roles/os10_fabric_summary/README.md @@ -2,7 +2,7 @@ os10_fabric_summary ===================================== This role is used to get show system information of all devices in the fabric. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The Fabric summary role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The Fabric summary role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Connection variables -------------------- diff --git a/roles/os10_flow_monitor/README.md b/roles/os10_flow_monitor/README.md index 7722190..dd98aa9 100644 --- a/roles/os10_flow_monitor/README.md +++ b/roles/os10_flow_monitor/README.md @@ -3,7 +3,7 @@ ACL flow-based monitor role This role facilitates configuring ACL flow-based monitoring attributes. Flow-based mirroring is a mirroring session in which traffic matches specified policies that are mirrored to a destination port. Port-based mirroring maintains a database that contains all monitoring sessions (including port monitor sessions). This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The ACL flow-based role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The ACL flow-based role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_image_upgrade/README.md b/roles/os10_image_upgrade/README.md index bb79fa3..9ae8f73 100644 --- a/roles/os10_image_upgrade/README.md +++ b/roles/os10_image_upgrade/README.md @@ -3,7 +3,7 @@ Image upgrade role This role facilitates upgrades or installation of a software image. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The Image upgrade role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The Image upgrade role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_interface/README.md b/roles/os10_interface/README.md index 5692285..bbb4f8e 100644 --- a/roles/os10_interface/README.md +++ b/roles/os10_interface/README.md @@ -3,7 +3,7 @@ Interface role This role facilitates the configuration of interface attributes. It supports the configuration of admin state, description, MTU, IP address, IP helper, suppress_ra, and port mode. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The Interface role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The Interface role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- @@ -49,9 +49,11 @@ Role variables | ``flowcontrol.mode`` | string: receive,transmit | Configures the flowcontrol mode | os10 | | ``flowcontrol.enable`` | string: on,off | Configures the flowcontrol mode on | os10 | | ``flowcontrol.state`` | string: absent,present\* | Deletes the flowcontrol if set to absent | os10 | -| ``ipv6_bgp_unnum`` | dictionary | Configures the ipv6 bgp unnum attributes (see ``ipv6_bgp_unnum.*``) below | os10 | -| ``ipv6_bgp_unnum.state`` | string: absent,present\* | Disable auto discovery of BGP unnumbered peer if set to absent | os10 | -| ``ipv6_bgp_unnum.peergroup_type`` | string: ebgp,ibgp | Specify the type of template to inherit from | os10 | +| ``ipv6_bgp_unnum`` | dictionary | Configures the IPv6 BGP unnum attributes (see ``ipv6_bgp_unnum.*``) below | os10 | +| ``ipv6_bgp_unnum.state`` | string: absent,present\* | Disables auto discovery of BGP unnumbered peer if set to absent | os10 | +| ``ipv6_bgp_unnum.peergroup_type`` | string: ebgp,ibgp | Specifies the type of template to inherit from | os10 | + +| ``stp_rpvst_default_behaviour`` | boolean: false,true | Configures RPVST default behaviour of BPDU's when set to True which is default | os10 | > **NOTE**: Asterisk (*) denotes the default value if none is specified. @@ -99,7 +101,8 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio os10_interface: ethernet 1/1/32: desc: "Connected to Core 2" - mtu: 2500 + mtu: 2500 + stp_rpvst_default_behaviour: False portmode: admin: up switchport: False @@ -126,6 +129,7 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio switchport: True suppress_ra: present admin: up + stp_rpvst_default_behaviour: False ethernet 1/1/3: desc: site2-spine2 ip_and_mask: 10.9.0.4/31 @@ -151,6 +155,7 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio admin: up switchport: False suppress_ra: + stp_rpvst_default_behaviour: True ipv6_bgp_unnum: state: present peergroup_type: ebgp diff --git a/roles/os10_interface/templates/os10_interface.j2 b/roles/os10_interface/templates/os10_interface.j2 index 294b457..c4dc61b 100644 --- a/roles/os10_interface/templates/os10_interface.j2 +++ b/roles/os10_interface/templates/os10_interface.j2 @@ -27,7 +27,8 @@ os10_interface: fanout: 10g-4x range ethernet 1/1/1-1/1/4: switchport: True - admin: down + admin: down + stp_rpvst_default_behaviour: False virtual-network 100: vrf: "test" ip_and_mask: "15.1.1.1/24" @@ -40,6 +41,9 @@ os10_interface: ipv6_bgp_unnum: state: present peergroup_type: ebgp + port-channel 20: + admin: up + stp_rpvst_default_behaviour: True vlan 10: ip_and_mask: "10.1.1.1/24" virtual_gateway_ip: "10.1.1.254" @@ -157,6 +161,15 @@ interface {{ interface_key }} ipv6 nd send-ra {% endif %} {% endif %} + + {% if intf_vars.stp_rpvst_default_behaviour is defined %} + {% if intf_vars.stp_rpvst_default_behaviour %} + spanning-tree rapid-pvst default-behavior + {% else %} + no spanning-tree rapid-pvst default-behavior + {% endif %} + {% endif %} + {% if intf_vars.ipv6_autoconfig is defined %} {% if intf_vars.ipv6_autoconfig %} ipv6 address autoconfig diff --git a/roles/os10_interface/tests/main.os10.yaml b/roles/os10_interface/tests/main.os10.yaml index e9f0fe2..d77b7fc 100644 --- a/roles/os10_interface/tests/main.os10.yaml +++ b/roles/os10_interface/tests/main.os10.yaml @@ -31,6 +31,7 @@ os10_interface: switchport: True suppress_ra: present admin: up + stp_rpvst_default_behaviour: False ethernet 1/1/3: desc: site2-spine2 ip_and_mask: 10.9.0.4/31 @@ -41,7 +42,7 @@ os10_interface: mode: "receive" enable: "on" state: "present" - + stp_rpvst_default_behaviour: True vlan 100: ip_and_mask: ipv6_and_mask: 2001:4898:5808:ffaf::1/64 @@ -61,6 +62,9 @@ os10_interface: ipv6_bgp_unnum: state: present peergroup_type: ebgp + port-channel 20: + admin: up + stp_rpvst_default_behaviour: False vlan 10: ip_and_mask: "10.1.1.1/24" virtual_gateway_ip: "10.1.1.254" diff --git a/roles/os10_lag/README.md b/roles/os10_lag/README.md index c5af266..eb679dc 100644 --- a/roles/os10_lag/README.md +++ b/roles/os10_lag/README.md @@ -3,7 +3,7 @@ LAG role This role facilitates the configuration of link aggregation group (LAG) attributes, and supports the creation and deletion of a LAG and its member ports. It also supports the configuration of an interface type as a static or dynamic LAG and minimum required link. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The LAG role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The LAG role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_lldp/README.md b/roles/os10_lldp/README.md index e2f01b3..0c08af4 100644 --- a/roles/os10_lldp/README.md +++ b/roles/os10_lldp/README.md @@ -3,7 +3,7 @@ LLDP role This role facilitates the configuration of link layer discovery protocol (LLDP) attributes at a global and interface level. It supports the configuration of hello, mode, multiplier, advertise TLVs, management interface, FCoE, and iSCSI at global and interface level. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The LLDP role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The LLDP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_logging/README.md b/roles/os10_logging/README.md index 2b65c3e..c8a2dbf 100644 --- a/roles/os10_logging/README.md +++ b/roles/os10_logging/README.md @@ -3,7 +3,7 @@ Logging role This role facilitates the configuration of global logging attributes, and it supports the configuration of logging servers. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The Logging role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The Logging role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_logging/templates/os10_logging.j2 b/roles/os10_logging/templates/os10_logging.j2 index 1bc7cfe..442376b 100644 --- a/roles/os10_logging/templates/os10_logging.j2 +++ b/roles/os10_logging/templates/os10_logging.j2 @@ -15,7 +15,7 @@ os10_logging: source_interface: "ethernet1/1/30" ###############################################} {% if os10_logging is defined and os10_logging %} - {% for key,value in os10_logging.iteritems() %} + {% for key,value in os10_logging.items() %} {% if key == "logging" %} {% for item in value %} {% if item.ip is defined and item.ip %} diff --git a/roles/os10_network_validation/README.md b/roles/os10_network_validation/README.md index 154f5a2..e9014c4 100644 --- a/roles/os10_network_validation/README.md +++ b/roles/os10_network_validation/README.md @@ -56,7 +56,7 @@ Ansible Dell EMC roles require connection information to establish communication | ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | | ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the _become_ method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | | ``ansible_become_pass`` | no | | Specifies the password to use, if required, to enter privileged mode on the remote device; if `ansible_become` is set to no, this key is not applicable | -| ``ansible_network_os`` | yes | os10, null\* | Value is used to load the correct terminal and cliconf plugins to communicate with the remote device | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | > **NOTE**: Asterisk (*) denotes the default value if none is specified. diff --git a/roles/os10_ntp/README.md b/roles/os10_ntp/README.md index 1fa151d..17e879c 100644 --- a/roles/os10_ntp/README.md +++ b/roles/os10_ntp/README.md @@ -3,7 +3,7 @@ NTP role This role facilitates the configuration of network time protocol (NTP) attributes. It specifically enables configuration of NTP server, NTP source, authentication, and broadcast service. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The NTP role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The NTP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- @@ -28,8 +28,9 @@ Role variables | ``authenticate`` | boolean | Configures authenticate time sources | os10 | | ``authentication_key`` | list | Configures authentication key for trusted time sources (see ``authentication_key.*``) | os10 | | ``authentication_key.key_num`` | integer | Configures authentication key number | os10 | -| ``authentication_key.key_string_type`` | integer: 0,7 | Configures hidden authentication key string if the value is 7, and configures unencrypted authentication key string if the value is 0 | os10 | +| ``authentication_key.key_string_type`` | integer: 0,9 | Configures hidden authentication key string if the value is 9, and configures unencrypted authentication key string if the value is 0 | os10 | | ``authentication_key.key_string`` | string | Configures the authentication key string | os10 | +| ``authentication_key.type`` | string: md5,sha1,sha2-256 | Configures the authentication type | os10 | | ``authentication_key.state`` | string: absent,present\* | Deletes the authenticaton key if set to absent | os10 | | ``trusted_key`` | list | Configures key numbers for trusted time sources (see ``trusted_key.*``) | os10 | | ``trusted_key.key_num`` | integer | Configures the key number | os10 | @@ -38,6 +39,9 @@ Role variables | ``intf.`` | dictionary | Configures NTP on the interface (see ``.*``) | os10 | | ``.disable`` | boolean | Configures NTP disable on the interface | os10 | | ``.broadcast`` | boolean | Configures NTP broadcast client service on the interface | os10 | +| ``vrf`` | dictionary | Enables NTP on VRF (see ``vrf.*``) | os10 | +| ``vrf.name`` | string | Name of the VRF to enable NTP | os10 | +| ``vrf.state`` | string: absent,present\* | Disables NTP on the VRF if set to absent | os10 | > **NOTE**: Asterisk (\*) denotes the default value if none is specified. @@ -87,8 +91,9 @@ By including the role, you automatically get access to all of the tasks to confi authenticate: true authentication_key: - key_num: 123 - key_string_type: 7 + key_string_type: 9 key_string: test + type: md5 state: present trusted_key: - key_num: 1323 @@ -102,6 +107,9 @@ By including the role, you automatically get access to all of the tasks to confi ethernet 1/1/2: disable: true broadcast: true + vrf: + name: red + state: present **Simple playbook to setup NTP — leaf.yaml** diff --git a/roles/os10_ntp/tasks/main.yml b/roles/os10_ntp/tasks/main.yml index e60abf2..202e560 100644 --- a/roles/os10_ntp/tasks/main.yml +++ b/roles/os10_ntp/tasks/main.yml @@ -14,3 +14,28 @@ when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") # notify: save config os10 register: output + + - name: "Generating NTP VRF configuration for os10" + lineinfile: + path: "{{ build_dir }}/ntp10_{{ hostname }}.conf.part" + line: "{{ lookup('template', 'os10_ntp_vrf.j2') }}" + insertafter: EOF + when: > + (ansible_network_os is defined and + ansible_network_os == "dellemc.os10.os10" and + ((os10_cfg_generate | default('False')) | bool) and + os10_ntp.vrf is defined and + os10_ntp.vrf) + + - name: "Provisioning NTP VRF configuration for os10" + os10_config: + lines: + - command: "{{ lookup('template', 'os10_ntp_vrf.j2') }}" + prompt: "Do you want to continue" + answer: "yes" + when: > + (ansible_network_os is defined and + ansible_network_os == "dellemc.os10.os10" and + os10_ntp.vrf is defined and + os10_ntp.vrf) +# notify: save config os10 diff --git a/roles/os10_ntp/templates/os10_ntp.j2 b/roles/os10_ntp/templates/os10_ntp.j2 index 7a6cdc2..7524c93 100644 --- a/roles/os10_ntp/templates/os10_ntp.j2 +++ b/roles/os10_ntp/templates/os10_ntp.j2 @@ -6,10 +6,13 @@ os10_ntp: source: ethernet 1/1/2 master: 5 authenticate: true + vrf: + name: red authentication_key: - key_num: 123 key_string_type: 7 key_string: test + type: md5 state: present trusted_key: - key_num: 1323 @@ -77,7 +80,12 @@ no ntp authentication-key {{ item.key_num }} {% else %} {% if item.key_string_type is defined and item.key_string_type >= 0 %} {% if item.key_string is defined and item.key_string %} -ntp authentication-key {{ item.key_num }} md5 {{ item.key_string_type }} {{ item.key_string }} + {% if item.type is defined and item.type %} + {% set auth_type = item.type %} + {% else %} + {% set auth_type = 'md5' %} + {% endif%} +ntp authentication-key {{ item.key_num }} {{ auth_type }} {{ item.key_string_type }} {{ item.key_string }} {% endif %} {% endif %} {% endif %} diff --git a/roles/os10_ntp/templates/os10_ntp_vrf.j2 b/roles/os10_ntp/templates/os10_ntp_vrf.j2 new file mode 100644 index 0000000..d2e12a3 --- /dev/null +++ b/roles/os10_ntp/templates/os10_ntp_vrf.j2 @@ -0,0 +1,18 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +Purpose: +Configure NTP VRF for os10 Devices +os10_ntp: + vrf: + name: red + state: present +###############################################} +{% if os10_ntp is defined and os10_ntp %} + {% if os10_ntp.vrf is defined and os10_ntp.vrf.name is defined %} + {% if os10_ntp.vrf.state is defined and os10_ntp.vrf.state == "absent" %} +no ntp enable vrf {{ os10_ntp.vrf.name }} + {% else %} +ntp enable vrf {{ os10_ntp.vrf.name }} + {% endif%} + {% endif %} +{% endif %} diff --git a/roles/os10_prefix_list/README.md b/roles/os10_prefix_list/README.md index d0a3128..dce141e 100644 --- a/roles/os10_prefix_list/README.md +++ b/roles/os10_prefix_list/README.md @@ -3,7 +3,7 @@ Prefix-list role This role facilitates the configuration of a prefix-list. It supports the configuration of an IP prefix-list, and assigns the prefix-list to line terminals. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The prefix-list role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The prefix-list role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_qos/README.md b/roles/os10_qos/README.md index e8588a3..5841597 100644 --- a/roles/os10_qos/README.md +++ b/roles/os10_qos/README.md @@ -3,7 +3,7 @@ QoS role This role facilitates the configuration quality of service (QoS) attributes like policy-map and class-map. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The QoS role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The QoS role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_raguard/README.md b/roles/os10_raguard/README.md index eb6c05c..abf7cf4 100644 --- a/roles/os10_raguard/README.md +++ b/roles/os10_raguard/README.md @@ -3,7 +3,7 @@ IPv6 RA uard role This role facilitates the configuration of IPv6 RA Guard attributes. It specifically enables configuration of IPv6 RA Guard feature enable/disable, IPv6 RA Guard policy definition and policy parameter configuration, and attachment of IPv6 RA Guard policy to an interface. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The IPv6 RA Guard role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The IPv6 RA Guard role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_route_map/README.md b/roles/os10_route_map/README.md index 1976df3..1160ca4 100644 --- a/roles/os10_route_map/README.md +++ b/roles/os10_route_map/README.md @@ -3,7 +3,7 @@ Route-map role This role facilitates the configuration of route-map attributes. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The route-map role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The route-map role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- @@ -57,7 +57,7 @@ Role variables | ``as_path.access_list`` | string (required) | Configures the access-list name | os10 | | ``as_path.permit`` | boolean (required) | Configures an AS path to accept or reject | os10 | | ``as_path.regex``| string (required) | Configures a regular expression | os10 | -| ``as_path.state`` | string: absent,present\* | deletes the BGP as path filter if set to absent | os10 | +| ``as_path.state`` | string: absent,present\* | Deletes the BGP as path filter if set to absent | os10 | | ``community_list`` | list | Configures a community list entry (see ``community_list.*``) | os10 | | ``community_list.type`` | string (required): standard,expanded | Configures the type of community-list entry | os10 | | ``community_list.name`` | string (required) | Configures the name of community-list entry | os10 | diff --git a/roles/os10_snmp/README.md b/roles/os10_snmp/README.md index e5eb051..a875a23 100644 --- a/roles/os10_snmp/README.md +++ b/roles/os10_snmp/README.md @@ -3,7 +3,7 @@ SNMP role This role facilitates the configuration of global SNMP attributes. It supports the configuration of SNMP server attributes including users, group, community, location, and traps. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The SNMP role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The SNMP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- @@ -23,21 +23,74 @@ Role variables | ``snmp_community`` | list | Configures SNMP community information (see ``snmp_community.*``) | os10 | | ``snmp_community.name`` | string (required) | Configures the SNMP community string | os10 | | ``snmp_community.access_mode`` | string: ro,rw | Configures access-mode for the community | os10 | +| ``snmp_community.access_list`` | dictionary | Configures ACL for the community (see ``snmp_community.access_list.*``) | os10 | +| ``snmp_community.access_list.name`` | string | Specifies the name of the ACL for the community | os10 | +| ``snmp_community.access_list.state`` | string: absent,present\* | Deletes the ACL from the community if set to absent | os10 | | ``snmp_community.state`` | string: absent,present\* | Deletes the SNMP community information if set to absent | os10 | +| ``snmp_engine_id`` | string | Configures SNMP local EngineID | os10 | +| ``snmp_remote_engine_id`` | list | Configures SNMP remote engine information (see ``snmp_remote_engine_id.*``) | os10 | +| ``snmp_remote_engine_id.ip`` | string | Configures the IP address of the SNMP remote engine | os10 | +| ``snmp_remote_engine_id.engine_id`` | string | Configures the EngineID of the SNMP remote engine | os10 | +| ``snmp_remote_engine_id.udpport`` | string | Configures the UDP port of the SNMP remote engine | os10 | +| ``snmp_remote_engine_id.state`` | string: absent,present\* | Deletes the SNMP remote engine information if set to absent | os10 | +| ``snmp_group`` | list | Configures the SNMP group information (see ``snmp_group.*``) | os10 | +| ``snmp_group.name`` | string | Configures the name of the SNMP group | os10 | +| ``snmp_group.version`` | string: 1,2c,3 | Configures the version of the SNMP group | os10 | +| ``snmp_group.security_level`` | string: auth,noauth,priv | Configures the security level of SNMP group for version 3 | os10 | +| ``snmp_group.access_list`` | dictionary | Configures the access list of the SNMP group (see ``snmp_group.access_list.*``)| os10 | +| ``snmp_group.access_list.name`` | string | Specifies the name of the access list for the SNMP group wtih version 1 or 2c | os10 | +| ``snmp_group.access_list.state`` | string: absent,present\* | Deletes the access list from the SNMP group if set to absent | os10 | +| ``snmp_group.read_view`` | dictionary | Configures the read view of the SNMP group (see ``snmp_group.read_view.*``) | os10 | +| ``snmp_group.read_view.name`` | string | Specifies the name of the read view for the SNMP group | os10 | +| ``snmp_group.read_view.state`` | string: absent,present\* | Deletes the read view from the SNMP group if set to absent | os10 | +| ``snmp_group.write_view`` | dictionary | Configures the write view of the SNMP group (see ``snmp_group.write_view``) | os10 | +| ``snmp_group.write_view.name`` | string | Specifies the name of the write view for the SNMP group | os10 | +| ``snmp_group.write_view.state`` | string: absent,present\* | Deletes the write view from the SNMP group if set to absent | os10 | +| ``snmp_group.notify_view`` | dictionary | Configures the notify view of the SNMP group (see ``snmp_group.notify_view.*``) | os10 | +| ``snmp_group.notify_view.name`` | string | Specifies the name of the notify view for the SNMP group | os10 | +| ``snmp_group.notify_view.state`` | string: absent,present\* | Deletes the notify view from the SNMP group if set to absent | os10 | +| ``snmp_group.state`` | string: absent,present\* | Deletes the SNMP group if set to absent | os10 | | ``snmp_host`` | list | Configures SNMP hosts to receive SNMP traps (see ``snmp_host.*``) | os10 | | ``snmp_host.ip`` | string | Configures the IP address of the SNMP trap host | os10 | -| ``snmp_host.communitystring`` | string | Configures the SNMP community string of the trap host | os10 | +| ``snmp_host.communitystring`` | string | Configures the SNMP community string of the trap host for version 1 or 2c | os10 | | ``snmp_host.udpport`` | string | Configures the UDP number of the SNMP trap host (0 to 65535) | os10 | -| ``snmp_host.version`` | string (required) | Specifies the SNMP version of the host (1 or 2c in os10) | os10 | +| ``snmp_host.version`` | string: 1,2c,3 (required) | Specifies the SNMP version of the host (1 or 2c or 3 in os10) | os10 | +| ``snmp_host.security_level`` | string: auth,noauth,priv | Configures the security level of the SNMP host for version 3 | os10 | +| ``snmp_host.security_name`` | string | Configures the security name of the SNMP host for version 3 | os10 | +| ``snmp_host.notification_type`` | string: traps,informs | Configures the notification type of the SNMP host | os10 | +| ``snmp_host.trap_categories`` | dictionary | Enables or disables different trap categories for the SNMP host (see ``snmp_host.trap_categories.*``) | os10 | +| ``snmp_host.trap_categories.dom`` | boolean: true,false | Enables or disables dom category traps for the SNMP host | os10 | +| ``snmp_host.trap_categories.entity`` | boolean: true,false | Enables or disables entity category traps for the SNMP host | os10 | +| ``snmp_host.trap_categories.envmon`` | boolean: true,false | Enables or disables envmon category traps for the SNMP host | os10 | +| ``snmp_host.trap_categories.lldp`` | boolean: true,false | | Enables or disables lldp category traps for the SNMP host | os10 | +| ``snmp_host.trap_categories.snmp`` | boolean: true,false | | Enables or disables snmp category traps for the SNMP host | os10 | | ``snmp_host.state`` | string: absent,present\* | Deletes the SNMP trap host if set to absent | os10 | +| ``snmp_source_interface`` | string | Configures the source interface for SNMP | os10 | | ``snmp_traps`` | list | Configures SNMP traps (see ``snmp_traps.*``) | os10 | | ``snmp_traps.name`` | string | Enables SNMP traps | os10 | | ``snmp_traps.state`` | string: absent,present\* | Deletes the SNMP trap if set to absent | os10 | +| ``snmp_user`` | list | Configures the SNMP user information (see ``snmp_user.*``) | os10 | +| ``snmp_user.name`` | string | Specifies the name of the SNMP user | os10 | +| ``snmp_user.group_name`` | string | Specifies the group of the SNMP user | os10 | +| ``snmp_user.version `` | string: 1,2c,3 | Configures the version for the SNMP user | os10 | +| ``snmp_user.access_list`` | string | Configures the access list for the SNMP user with version 1 or 2c | os10 | +| ``snmp_user.authentication`` | dictionary | Configures the authentication information for the SNMP user with version 3 (see ``snmp_user.authentication.*``) | os10 | +| ``snmp_user.authentication.localized`` | boolean: true,false | Configures the password to be in localized key format or not | os10 | +| ``snmp_user.authentication.algorithm`` | string: md5, sha | Configures the authentication algorithm for the SNMP user | os10 | +| ``snmp_user.authentication.password`` | string | Configures the authentication password for the SNMP user; if localized is true it should be a hexadecimal string prefixed with 0x and qouted | os10 | +| ``snmp_user.authentication.encryption`` | dictionary | Configures the encryption parameters for the SNMP user | os10 | +| ``snmp_user.authentication.encryption.algorithm`` | string: aes,des | Configures the encryption algorithm for the SNMP user | os10 | +| ``snmp_user.authentication.encryption.password`` | string | Configures encryption password for the SNMP user; if localized is true it should be a hexadecimal string prefixed with 0x and qouted | os10 | +| ``snmp_user.remote`` | dictionary | Configures the remote SNMP entity the user belongs to (see ``snmp_user.remote.*``) | os10 | +| ``snmp_user.remote.ip`` | string | Configures the IP address of the remote entity for the SNMP user | os10 | +| ``snmp_user.remote.udpport`` | string | Configures the UDP port of the remote entiry for the SNMP user | os10 | +| ``snmp_user.state`` | string: absent,present\* | Deletes the SNMP user if set to absent | os10 | | ``snmp_view`` | list | Configures SNMPv3 view information (see ``snmp_view.*``) | os10 | | ``snmp_view.name`` | string | Configures the SNMP view name (up to 20 characters) | os10 | | ``snmp_view.oid_subtree`` | integer | Configures the SNMP view for the OID subtree | os10 | | ``snmp_view.include`` | boolean: true,false | Specifies if the MIB family should be included or excluded from the view | os10 | | ``snmp_view.state`` | string: absent,present\* | Deletes the SNMP view if set to absent | os10 | +| ``snmp_vrf`` | string | Configures the VRF for SNMP | os10 | > **NOTE**: Asterisk (\*) denotes the default value if none is specified. @@ -86,9 +139,20 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio os10_snmp: snmp_contact: test snmp_location: Chennai + snmp_source_interface: loopback 10 + snmp_vrf: test snmp_community: - name: public access_mode: ro + access_list: + name: test_acl + state: present + state: present + snmp_engine_id: 123456789 + snmp_remote_engine_id: + - host: 1.1.1.1 + engine_id: '0xab' + udpport: 162 state: present snmp_traps: - name: all @@ -107,6 +171,89 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio - ip: 2.2.2.2 version: 1 communitystring: c3 + trap_categories: + dom: true + lldp: true + state: present + - ip: 3.1.1.1 + version: 3 + security_level: priv + security_name: test + notification_type: informs + udpport: 200 + trap_categories: + dom: true + entity: true + envmon: true + snmp: true + state: present + snmp_group: + - name: group_1 + version: "2c" + state: present + access_list: + name: test_acl + state: present + read_view: + name: view_1 + state: present + write_view: + name: view_2 + state: present + notify_view: + name: view_3 + state: present + - name: group_2 + version: 3 + security_level: priv + state: present + read_view: + name: view_1 + state: absent + notify_view: + name: view_3 + state: present + snmp_user: + - name: user_1 + group_name: group_1 + version: 3 + authentication: + localized: true + algorithm: md5 + password: 9fc53d9d908118b2804fe80e3ba8763d + encryption: + algorithm: aes + password: d0452401a8c3ce42804fe80e3ba8763d + state: present + - name: user_2 + group_name: group_1 + version: 3 + remote: + ip: 1.1.1.1 + udpport: 200 + authentication: + localized: true + algorithm: md5 + password: '0x9fc53d9d908118b2804fe80e3ba8763d' + encryption: + algorithm: aes + password: '0xd0452401a8c3ce42804fe80e3ba8763d' + state: present + - name: user_3 + group_name: group_1 + version: 2c + state: present + - name: user_4 + group_name: group_1 + version: 3 + state: present + - name: user_5 + group_name: group_2 + version: 2c + remote: + ip: 1.1.1.1 + udpport: 200 + access_list: test_acl state: present **Simple playbook to setup SNMP — leaf.yaml** diff --git a/roles/os10_snmp/templates/os10_snmp.j2 b/roles/os10_snmp/templates/os10_snmp.j2 index 65ed9a3..f958170 100644 --- a/roles/os10_snmp/templates/os10_snmp.j2 +++ b/roles/os10_snmp/templates/os10_snmp.j2 @@ -5,13 +5,24 @@ Configure snmp commands for os10 Devices os10_snmp: snmp_contact: test snmp_location: Chennai + snmp_vrf: test + snmp_source_interface: loopback 10 snmp_community: - name: public access_mode: ro + access_list: + name: test_acl + state: present state: present snmp_traps: - name: all state: present + snmp_engine_id: 123456789 + snmp_remote_engine_id: + - host: 1.1.1.1 + engine_id: '0xab' + udpport: 162 + state: present snmp_view: - name: view_1 oid_subtree: 2 @@ -27,24 +38,91 @@ os10_snmp: version: 1 communitystring: c3 state: present + - ip: 3.1.1.1 + version: 3 + security_level: priv + security_name: test + notification_type: informs + udpport: 200 + trap_categories: + dom: true + entity: true + envmon: true + snmp: true + state: present + snmp_group: + - name: group_1 + version: "2c" + state: present + access_list: + name: test_acl + state: present + read_view: + name: view_1 + state: present + write_view: + name: view_2 + state: present + notify_view: + name: view_3 + state: present + - name: group_2 + version: 3 + security_level: priv + state: present + read_view: + name: view_1 + state: absent + notify_view: + name: view_3 + state: present + snmp_user: + - name: user_1 + group_name: group_1 + version: 3 + authentication: + localized: true + algorithm: md5 + password: 9fc53d9d908118b2804fe80e3ba8763d + encryption: + algorithm: aes + password: d0452401a8c3ce42804fe80e3ba8763d + state: present + - name: user_2 + group_name: group_1 + version: 3 + remote: + ip: 1.1.1.1 + udpport: 200 + authentication: + localized: true + algorithm: md5 + password: '0x9fc53d9d908118b2804fe80e3ba8763d' + encryption: + algorithm: aes + password: '0xd0452401a8c3ce42804fe80e3ba8763d' + state: present + - name: user_3 + group_name: group_1 + version: 2c + state: present + - name: user_4 + group_name: group_1 + version: 3 + state: present + - name: user_5 + group_name: group_2 + version: 2c + remote: + ip: 1.1.1.1 + udpport: 200 + access_list: test_acl + state: present + ###############################################} {% if os10_snmp is defined and os10_snmp %} -{% for key,value in os10_snmp.items() %} - {% if key == "snmp_contact" %} - {% if value %} -snmp-server contact {{ value }} - {% else %} -no snmp-server contact - {% endif %} - - {% elif key == "snmp_location" %} - {% if value %} -snmp-server location {{ value }} - {% else %} -no snmp-server location - {% endif %} - - {% elif key == "snmp_community" %} + {% if os10_snmp.snmp_community is defined %} + {% set value = os10_snmp.snmp_community %} {% if value %} {% for item in value %} {% if item.name is defined and item.name %} @@ -52,20 +130,91 @@ no snmp-server location {% if item.state is defined and item.state == "absent" %} no snmp-server community {{ item.name }} {{ item.access_mode }} {% else %} + {% if item.access_list is defined and item.access_list and item.access_list.name is defined and item.access_list.name %} + {% if item.access_list.state is defined and item.access_list.state == "absent" %} +no snmp-server community {{ item.name }} {{ item.access_mode }} acl {{ item.access_list.name }} + {% else %} +snmp-server community {{ item.name }} {{ item.access_mode }} acl {{ item.access_list.name }} + {% endif %} + {% else %} snmp-server community {{ item.name }} {{ item.access_mode }} + {% endif %} {% endif %} {% endif %} {% endif %} {% endfor %} {% endif %} + {% endif %} + + {% if os10_snmp.snmp_contact is defined %} + {% set value = os10_snmp.snmp_contact %} + {% if value %} +snmp-server contact {{ value }} + {% else %} +no snmp-server contact + {% endif %} + {% endif %} + + {% if os10_snmp.snmp_engine_id is defined %} + {% set value = os10_snmp.snmp_engine_id %} + {% if value %} +snmp-server engineID local {{ value }} + {% else %} +no snmp-server engineID local + {% endif %} + {% endif %} + + {# Remove users before removing remote engine #} + {% if os10_snmp.snmp_user is defined and os10_snmp.snmp_user %} + {% set value = os10_snmp.snmp_user %} + {% for item in value %} + {% if item.name is defined and item.name and item.group_name is defined and item.group_name %} + {% if item.state is defined and item.state == "absent" %} + {% set user_remote_option = "" %} + {% if item.remote is defined and item.remote %} + {% if item.remote.ip is defined and item.remote.ip %} + {% if item.remote.udpport is defined and item.remote.udpport %} + {% set user_remote_option = " remote " + item.remote.ip + " udp-port " + item.remote.udpport|string %} + {% endif %} + {% endif %} + {% endif %} +no snmp-server user {{ item.name }} {{ item.group_name }}{{ user_remote_option }} {{ item.version }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} - {% elif key == "snmp_traps" %} + {% if os10_snmp.snmp_remote_engine_id is defined %} + {% set value = os10_snmp.snmp_remote_engine_id %} + {% for item in value %} + {% if item.host is defined and item.host %} + {% if item.state is defined and item.state == "absent" %} + {% if item.udpport is defined and item.udpport %} +no snmp-server engineID remote {{ item.host }} udp-port {{ item.udpport }} + {% else %} +no snmp-server engineID remote {{ item.host }} + {% endif %} + {% else %} + {% if item.engine_id is defined and item.engine_id %} + {% if item.udpport is defined and item.udpport %} +snmp-server engineID remote {{ item.host }} udp-port {{ item.udpport }} {{ item.engine_id }} + {% else %} +snmp-server engineID remote {{ item.host }} udp-port 162 {{ item.engine_id }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if os10_snmp.snmp_traps is defined %} + {% set value = os10_snmp.snmp_traps %} {% if value %} {% for val in value %} {% if val.name is defined and val.name %} {% if val.state is defined and val.state == "absent" %} {% if val.name == "all" %} - {% set trap_list = ['snmp authentication','snmp linkdown','snmp linkup','envmon fan','envmon power-supply','envmon temperature'] %} + {% set trap_list = ['snmp authentication','snmp linkDown','snmp linkUp','envmon fan','envmon power-supply','envmon temperature'] %} {% for name in trap_list %} no snmp-server enable traps {{ name }} {% endfor %} @@ -74,7 +223,7 @@ no snmp-server enable traps {{ val.name }} {% endif %} {% else %} {% if val.name == "all" %} - {% set trap_list = ['snmp authentication','snmp linkdown','snmp linkup','envmon fan','envmon power-supply','envmon temperature'] %} + {% set trap_list = ['snmp authentication','snmp linkDown','snmp linkUp','envmon fan','envmon power-supply','envmon temperature'] %} {% for name in trap_list %} snmp-server enable traps {{ name }} {% endfor %} @@ -85,8 +234,180 @@ snmp-server enable traps {{ val.name }} {% endif %} {% endfor %} {% endif %} + {% endif %} - {% elif key == "snmp_view" %} + {% if os10_snmp.snmp_group is defined and os10_snmp.snmp_group %} + {% set value = os10_snmp.snmp_group %} + {% for item in value %} + {% if item.name is defined and item.name and item.version is defined and item.version %} + {% set group_value = item.name + " " + item.version|string %} + {% if item.security_level is defined and item.security_level %} + {% if item.version|string != "1" and item.version|string != "2c" %} + {% set group_value = group_value + " " + item.security_level %} + {% endif %} + {% endif %} + {% if item.state is defined and item.state == "absent" %} +no snmp-server group {{ group_value }} + {% else %} + {% set group_options = [] %} + {% if item.version|string == "1" or item.version|string == "2c" %} + {% if item.access_list is defined and item.access_list and item.access_list.name is defined and item.access_list.name %} + {% if item.access_list.state is defined and item.access_list.state == "absent" %} +no snmp-server group {{ group_value }} access {{ item.access_list.name }} + {% else %} + {{ group_options.append("access "+item.access_list.name) }} + {% endif %} + {% endif %} + {% endif %} + {% if item.notify_view is defined and item.notify_view and item.notify_view.name is defined and item.notify_view.name %} + {% if item.notify_view.state is defined and item.notify_view.state == "absent" %} +no snmp-server group {{ group_value }} notify {{ item.notify_view.name }} + {% else %} + {{ group_options.append("notify "+item.notify_view.name)}} + {% endif %} + {% endif %} + {% if item.read_view is defined and item.read_view and item.read_view.name is defined and item.read_view.name %} + {% if item.read_view.state is defined and item.read_view.state == "absent" %} +no snmp-server group {{ group_value }} read {{ item.read_view.name }} + {% else %} + {{ group_options.append("read "+item.read_view.name) }} + {% endif %} + {% endif %} + {% if item.write_view is defined and item.write_view and item.write_view.name is defined and item.write_view.name %} + {% if item.write_view.state is defined and item.write_view.state == "absent" %} +no snmp-server group {{ group_value }} write {{ item.write_view.name }} + {% else %} + {{ group_options.append("write "+item.write_view.name)}} + {% endif %} + {% endif %} +snmp-server group {{ group_value }} {{ group_options|join(" ") }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if os10_snmp.snmp_host is defined and os10_snmp.snmp_host %} + {% set value = os10_snmp.snmp_host %} + {% for item in value %} + {% if item.ip is defined and item.ip %} + {% set host_port_option = "" %} + {% if item.udpport is defined and item.udpport %} + {% set host_port_option = " udp-port " + item.udpport|string %} + {% endif %} + {% if item.state is defined and item.state == "absent" %} +no snmp-server host {{ item.ip }}{{ host_port_option }} + {% else %} + {% set host_notif_type = "traps" %} + {% if item.notification_type is defined and item.notification_type %} + {% set host_notif_type = item.notification_type %} + {% endif %} + {% if item.version is defined and item.version %} + {% set host_version = "" %} + {% if item.version|string == "1" or item.version|string == "2c" %} + {% if item.communitystring is defined and item.communitystring %} + {% set host_version = item.version|string + " " + item.communitystring %} + {% endif %} + {% elif item.security_level is defined and item.security_level %} + {% if item.security_name is defined and item.security_name %} + {% set host_version = item.version|string + " " + item.security_level + " " + item.security_name %} + {% endif %} + {% endif %} + {% set host_trap_categories = [] %} + {% if item.trap_categories is defined and item.trap_categories %} + {% for cat_key, cat_value in item.trap_categories.items() %} + {% if cat_value %} + {% if cat_key == "dom" %} + {{ host_trap_categories.append("dom")}} + {% elif cat_key == "entity" %} + {{ host_trap_categories.append("entity") }} + {% elif cat_key == "envmon" %} + {{ host_trap_categories.append("envmon") }} + {% elif cat_key == "lldp" %} + {{ host_trap_categories.append("lldp") }} + {% elif cat_key == "snmp" %} + {{ host_trap_categories.append("snmp") }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if host_version %} +snmp-server host {{ item.ip }} {{ host_notif_type }} version {{ host_version }}{{ host_port_option }} {{ host_trap_categories|join(" ") }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if os10_snmp.snmp_location is defined %} + {% set value = os10_snmp.snmp_location %} + {% if value %} +snmp-server location {{ value }} + {% else %} +no snmp-server location + {% endif %} + {% endif %} + + {% if os10_snmp.snmp_source_interface is defined %} + {% set value = os10_snmp.snmp_source_interface %} + {% if value %} +snmp-server source-interface {{ value.split() | join() }} + {% else %} +no snmp-server source-interface + {% endif %} + {% endif %} + + {% if os10_snmp.snmp_user is defined and os10_snmp.snmp_user %} + {% set value = os10_snmp.snmp_user %} + {% for item in value %} + {% if item.name is defined and item.name and item.group_name is defined and item.group_name %} + {% if item.version is defined and item.version %} + {% if item.state is defined and item.state == "absent" %} + {# snmp user removal is handled above remote engind id #} + {% else %} + {% set user_remote_option = "" %} + {% if item.remote is defined and item.remote %} + {% if item.remote.ip is defined and item.remote.ip %} + {% if item.remote.udpport is defined and item.remote.udpport %} + {% set user_remote_option = " remote " + item.remote.ip + " udp-port " + item.remote.udpport|string %} + {% endif %} + {% endif %} + {% endif %} + {% if item.version|string == "1" or item.version|string == "2c" %} + {% set user_acl_option = "" %} + {% if item.access_list is defined and item.access_list %} + {% set user_acl_option = "access " + item.access_list %} + {% endif %} +snmp-server user {{ item.name }} {{ item.group_name }}{{ user_remote_option }} {{ item.version }} {{ user_acl_option }} + {% else %} + {% set user_auth_option = "" %} + {% if item.authentication is defined and item.authentication %} + {% if item.authentication.localized is defined and item.authentication.localized %} + {% set user_auth_option = " localized" %} + {% endif %} + {% if item.authentication.algorithm is defined and item.authentication.algorithm %} + {% if item.authentication.password is defined and item.authentication.password %} + {% set user_auth_option = user_auth_option + " auth " + item.authentication.algorithm + " " + item.authentication.password %} + {% if item.authentication.encryption is defined and item.authentication.encryption %} + {% if item.authentication.encryption.algorithm is defined and item.authentication.encryption.algorithm %} + {% if item.authentication.encryption.password is defined and item.authentication.encryption.password %} + {% set user_auth_option = user_auth_option + " priv " + item.authentication.encryption.algorithm + " " + item.authentication.encryption.password %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} +snmp-server user {{ item.name }} {{ item.group_name }}{{ user_remote_option }} {{ item.version }}{{ user_auth_option }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if os10_snmp.snmp_view is defined %} + {% set value = os10_snmp.snmp_view %} {% if value %} {% for item in value %} {% if item.name is defined and item.name %} @@ -106,29 +427,15 @@ snmp-server view {{ item.name }} {{ item.oid_subtree }} excluded {% endif %} {% endfor %} {% endif %} + {% endif %} - {% elif key == "snmp_host" and value %} - {% for item in value %} - {% if item.ip is defined and item.ip %} - {% if item.version is defined and item.version == 1 or item.version == "2c" %} - {% if item.communitystring is defined and item.communitystring %} - {% if item.udpport is defined and item.udpport %} - {% set my_val = "traps version "+item.version|string+" "+item.communitystring+" udp-port "+item.udpport|string %} - {% else %} - {% set my_val = "traps version "+item.version|string+" "+item.communitystring %} - {% endif %} - {% endif %} - {% endif %} - {% if my_val is defined and my_val %} - {% if item.state is defined and item.state == "absent" %} -no snmp-server host {{ item.ip }} {{ my_val }} - {% else %} -snmp-server host {{ item.ip }} {{ my_val }} - {% endif %} - {% endif %} - {% set my_val = "" %} - {% endif %} - {% endfor%} + {% if os10_snmp.snmp_vrf is defined %} + {% set value = os10_snmp.snmp_vrf %} + {% if value %} +snmp-server vrf {{ value }} + {% else %} +no snmp-server vrf default + {% endif %} {% endif %} -{% endfor %} + {% endif %} diff --git a/roles/os10_system/README.md b/roles/os10_system/README.md index 955d3e7..119138a 100644 --- a/roles/os10_system/README.md +++ b/roles/os10_system/README.md @@ -3,7 +3,7 @@ System role This role facilitates the configuration of global system attributes. It specifically enables configuration of hostname and hashing algorithm. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The System role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The System role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- @@ -39,8 +39,8 @@ Role variables | ``load_balance.tcp_udp_selection`` | list | Configures TCP UDP ports for load balancing configurations (see ``tcp_udp_selection.*``) | os10 | | ``tcp_udp_selection.field`` | string | Configures TCP UDP port fields to use in hashing algorithm | os10 | | ``tcp_udp_selection.state`` | string: absent,present\* | Deletes the TCP UDP ports if set to absent | os10 | -| ``min_ra`` | string | Configure global RA minimum interval value, applicable to all interfaces across VRFs | os10 | -| ``max_ra`` | string | Configure global RA maximum interval value, applicable to all interfaces across VRFs | os10 | +| ``min_ra`` | string | Configures global RA minimum interval value, applicable to all interfaces across VRFs | os10 | +| ``max_ra`` | string | Configures global RA maximum interval value, applicable to all interfaces across VRFs | os10 | > **NOTE**: Asterisk (\*) denotes the default value if none is specified. diff --git a/roles/os10_template/README.md b/roles/os10_template/README.md index 8369b37..d7faf01 100644 --- a/roles/os10_template/README.md +++ b/roles/os10_template/README.md @@ -3,7 +3,7 @@ Template role This role provides access to structured data from show commands. This role facilitates the TEXTFSM parsing engine. TextFSM is a template based state machine . It takes the raw string input from the CLI of network devices, run them through a TEXTFSM template and return structured text in the form of a Python dictionary. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The Template role is highly customizable, and it works with separate template definitions which contain variables and rules with regular expressions. This library is very helpful to parse any text-based CLI output from network devices. The Template role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The Template role is highly customizable, and it works with separate template definitions which contain variables and rules with regular expressions. This library is very helpful to parse any text-based CLI output from network devices. The Template role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_template/tasks/main.yml b/roles/os10_template/tasks/main.yml index 90123a4..9b41a6c 100644 --- a/roles/os10_template/tasks/main.yml +++ b/roles/os10_template/tasks/main.yml @@ -15,4 +15,10 @@ import_tasks: show_ip_bgp_summary.yaml - name: os10 dellemc.os10.os10_template test - import_tasks: show_vlan.yaml + import_tasks: show_vlan.yaml + + - name: os10 dellemc.os10.os10_template test + import_tasks: show_vlt_err_disabled_ports.yaml + + - name: os10 dellemc.os10.os10_template test + import_tasks: show_spanning_tree_compatibility_mode.yaml diff --git a/roles/os10_template/tasks/show_spanning_tree_compatibility_mode.yaml b/roles/os10_template/tasks/show_spanning_tree_compatibility_mode.yaml new file mode 100644 index 0000000..a3c6952 --- /dev/null +++ b/roles/os10_template/tasks/show_spanning_tree_compatibility_mode.yaml @@ -0,0 +1,21 @@ +--- + - name: CAPTURE SHOW SPANNING TREE COMPATIBILITY MODE + os10_command: + commands: + - command: show spanning-tree compatibility-mode + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_spanning_tree_compatibility_mode + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_spanning_tree_compatibility_mode.template') }}" + content: "{{ output.stdout[0] }}" + name: spanning_tree_comp_mode_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/roles/os10_template/tasks/show_vlt_err_disabled_ports.yaml b/roles/os10_template/tasks/show_vlt_err_disabled_ports.yaml new file mode 100644 index 0000000..0e0f8b3 --- /dev/null +++ b/roles/os10_template/tasks/show_vlt_err_disabled_ports.yaml @@ -0,0 +1,20 @@ +--- + - name: CAPTURE SHOW VLT ERR DISABLED PORTS + dellos10_command: + commands: ['show vlt all error-disabled-ports'] + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_vlt_err_dis_ports + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_vlt_err_disabled_ports.template') }}" + content: "{{ output.stdout[0] }}" + name: vlt_err_dis_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/roles/os10_template/templates/os10_show_spanning_tree_compatibility_mode.template b/roles/os10_template/templates/os10_show_spanning_tree_compatibility_mode.template new file mode 100644 index 0000000..bf365e3 --- /dev/null +++ b/roles/os10_template/templates/os10_show_spanning_tree_compatibility_mode.template @@ -0,0 +1,6 @@ +Value Interface_name ([a-zA-Z\-]+\s*[\d\/\:]+) +Value Instance (VLAN\s+(\d+)) +Value Compatibility_mode (\S+\s*) + +Start + ^${Interface_name}\s+${Instance}\s+${Compatibility_mode} -> Record diff --git a/roles/os10_template/templates/os10_show_vlt_err_disabled_ports.template b/roles/os10_template/templates/os10_show_vlt_err_disabled_ports.template new file mode 100644 index 0000000..340b7a2 --- /dev/null +++ b/roles/os10_template/templates/os10_show_vlt_err_disabled_ports.template @@ -0,0 +1,5 @@ +Value VLT_PORT_CHANNEL_ID (\d+) +Value PORT_CHANNEL (\S+\s*) + +Start + ^${VLT_PORT_CHANNEL_ID}\s+${PORT_CHANNEL} -> Record diff --git a/roles/os10_uplink/README.md b/roles/os10_uplink/README.md index 5cf478f..8ffeb0e 100644 --- a/roles/os10_uplink/README.md +++ b/roles/os10_uplink/README.md @@ -3,7 +3,7 @@ Uplink role This role facilitates the configuration of uplink failure detection feature attributes. It specifically enables configuration of association between upstream and downstream interfaces known as uplink-state group. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The Uplink role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The Uplink role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- @@ -21,10 +21,14 @@ Role variables | ``uplink_state_group`` | list | Configures the uplink state group (see ``uplink_state_group.*``) | os10 | | ``uplink_state_group.id`` | integer | Configures the uplink state group instance | os10 | | ``uplink_state_group.enable`` | boolean: True,False | Enables the uplink state group instance | os10 | +| ``uplink_state_group.defer_time`` | integer | Configures defer timer for the uplink state group | os10 | | ``uplink_state_group.uplink_type`` | list | Configures the upstream and downstream attribute (see ``uplink_type.*``) | os10 | | ``uplink_type.type`` | string: upstream,downstream | Configures the uplink type | os10 | | ``uplink_type.intf`` | string | Configures the uplink interface | os10 | | ``uplink_type.state`` | string: absent,present\* | Removes the uplink stream if set to absent | os10 | +| ``uplink_state_group.downstream`` | dictionary | Configures downstream information for the uplink state group (see ``downstream.*``) | os10 | +| ``downstream.disable_links`` | integer | Configures number of downstream links to be disabled. String 'all' can be used to disable all downstream links | os10 | +| ``downstream.auto_recover`` | boolean: True,False | Enables or disables auto recover for downstream interfaces | os10 | | ``uplink_state_group.state`` | string: absent,present\* | Removes the uplink state group instance if set to absent | os10 | > **NOTE**: Asterisk (\*) denotes the default value if none is specified. @@ -82,6 +86,10 @@ When `os10_cfg_generate` is set to true, the variable generates the configuratio intf: "ethernet1/1/2-1/1/5" state: "present" state: "present" + downstream: + disable_links: all + auto_recover: false + defer_time: 50 - id: 2 enable: True state: "present" diff --git a/roles/os10_uplink/templates/os10_uplink.j2 b/roles/os10_uplink/templates/os10_uplink.j2 index 0dd4290..64a237d 100644 --- a/roles/os10_uplink/templates/os10_uplink.j2 +++ b/roles/os10_uplink/templates/os10_uplink.j2 @@ -14,7 +14,25 @@ os10_uplink: - type: "downstream" intf: "ethernet1/1/2-1/1/5" state: "present" + downstream: + disable_links: all + auto_recover: false + defer_time: 50 state: "present" + - id: 1 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel1" + state: "present" + - type: "downstream" + intf: "ethernet1/1/2-1/1/5" + state: "present" + downstream: + disable_links: 10 + auto_recover: false + state: "present" + ###############################################} {% if os10_uplink is defined and os10_uplink %} {% if os10_uplink.uplink_state_group is defined and os10_uplink.uplink_state_group %} @@ -31,6 +49,22 @@ uplink-state-group {{ uplink_val.id }} no enable {% endif %} {% endif %} + {% if uplink_val.downstream is defined and uplink_val.downstream %} + {% if uplink_val.downstream.auto_recover is defined %} + {% if uplink_val.downstream.auto_recover %} + downstream auto-recover + {% else %} + no downstream auto-recover + {% endif %} + {% endif %} + {% if uplink_val.downstream.disable_links is defined %} + {% if uplink_val.downstream.disable_links %} + downstream disable-links {{ uplink_val.downstream.disable_links }} + {% else %} + no downstream disable-links + {% endif %} + {% endif %} + {% endif %} {% if uplink_val.uplink_type is defined and uplink_val.uplink_type %} {% for uplink in uplink_val.uplink_type %} {% if uplink.type is defined and uplink.type %} @@ -54,6 +88,13 @@ uplink-state-group {{ uplink_val.id }} {% endif %} {% endfor %} {% endif %} + {% if uplink_val.defer_time is defined %} + {% if uplink_val.defer_time %} + defer-time {{ uplink_val.defer_time }} + {% else %} + no defer-time + {% endif %} + {% endif %} {% endif %} {% endif %} {% endfor %} diff --git a/roles/os10_users/README.md b/roles/os10_users/README.md index 337010d..09d55f1 100644 --- a/roles/os10_users/README.md +++ b/roles/os10_users/README.md @@ -3,7 +3,7 @@ Users role This role facilitates the configuration of global system user attributes, and it supports the configuration of CLI users. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The Users role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The Users role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_vlan/README.md b/roles/os10_vlan/README.md index 275181e..71a7adf 100644 --- a/roles/os10_vlan/README.md +++ b/roles/os10_vlan/README.md @@ -3,7 +3,7 @@ VLAN role This role facilitates configuring virtual LAN (VLAN) attributes. It supports the creation and deletion of a VLAN and its member ports. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The VLAN role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The VLAN role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_vlan/templates/os10_vlan.j2 b/roles/os10_vlan/templates/os10_vlan.j2 index 15fbece..f07f10b 100644 --- a/roles/os10_vlan/templates/os10_vlan.j2 +++ b/roles/os10_vlan/templates/os10_vlan.j2 @@ -88,7 +88,11 @@ interface vlan{{ vlan_id[1] }} {% if vlan_vars.untagged_members is defined %} {% for ports in vlan_vars.untagged_members %} {% if ports.port is defined and ports.port %} + {% if 'range' in ports.port %} +interface {{ ports.port }} + {% else %} interface {{ ports.port.split() | join() }} + {% endif %} {% if ports.state is defined and ports.state == "absent" %} no switchport access vlan {% else %} @@ -101,7 +105,11 @@ interface {{ ports.port.split() | join() }} {% if vlan_vars.tagged_members is defined %} {% for ports in vlan_vars.tagged_members %} {% if ports.port is defined and ports.port %} + {% if 'range' in ports.port %} +interface {{ ports.port }} + {% else %} interface {{ ports.port.split() | join() }} + {% endif %} {% if ports.state is defined and ports.state == "absent" %} no switchport trunk allowed vlan {{ vlan_id[1] }} {% else %} diff --git a/roles/os10_vlt/README.md b/roles/os10_vlt/README.md index ed24d38..85ed917 100644 --- a/roles/os10_vlt/README.md +++ b/roles/os10_vlt/README.md @@ -3,7 +3,7 @@ VLT role This role facilitates the configuration of the basics of virtual link trunking (VLT) to provide a loop-free topology. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The VLT role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables . +The VLT role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables . Role variables -------------- diff --git a/roles/os10_vrf/README.md b/roles/os10_vrf/README.md index 000ba10..464efc5 100644 --- a/roles/os10_vrf/README.md +++ b/roles/os10_vrf/README.md @@ -3,7 +3,7 @@ VRF role This role facilitates to configure the basics of virtual routing and forwarding (VRF) that helps in the partition of physical routers to multiple virtual routers. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The VRF role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The VRF role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_vrrp/README.md b/roles/os10_vrrp/README.md index 1771c50..299166b 100644 --- a/roles/os10_vrrp/README.md +++ b/roles/os10_vrrp/README.md @@ -3,7 +3,7 @@ VRRP role This role facilitates configuring virtual router redundancy protocol (VRRP) attributes. It supports the creation of VRRP groups for interfaces and setting the VRRP group attributes. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The VRRP role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The VRRP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/roles/os10_vxlan/README.md b/roles/os10_vxlan/README.md index c517baf..09b23bb 100644 --- a/roles/os10_vxlan/README.md +++ b/roles/os10_vxlan/README.md @@ -1,9 +1,9 @@ VxLAN role ======== -This role facilitates the configuration of virtual extensible LAN (VxLAN) attributes. It supports the configuration of virtual networks, Ethernet virtual private network (EVPN), and network virtualization edge (NVE). This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. +This role facilitates the configuration of virtual extensible LAN (VxLAN) attributes. It supports the configuration of virtual networks, Ethernet virtual private network (EVPN), and network virtualization edge (NVE). This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The VxLAN role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The VxLAN role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- @@ -18,7 +18,7 @@ Role variables | Key | Type | Description | Support | |------------|---------------------------|---------------------------------------------------------|-----------------------| -| ``anycast_gateway_mac`` | string | Configures an anycast gateway IP address for a VXLAN virtual network | os10 | +| ``anycast_gateway_mac`` | string | Configures an anycast gateway IP address for a VxLAN virtual network | os10 | | ``loopback`` | dictionary | Configures the loopback interface (see ``loopback.*``) | os10 | | ``loopback.loopback_id`` | integer | Configures the loopback interface number (0 to 16383) | os10 | | ``loopback.description`` | string | Configures the interface description | os10 | @@ -27,57 +27,58 @@ Role variables | ``nve`` | dictionary | Configures network virtualization edge (see ``nve.*``) | os10 | | ``nve.source_interface`` | integer | Configures source loopback interface | os10 | | ``nve.controller`` | dictionary | Configures controller; supports only one controller connection at a time (see ``controller.*``) | os10 | -| ``controller.name`` | string: NSX, ovsdb | Configures the nve controller | os10 | -| ``controller.max_backoff`` | integer | Configures max_backoff value (Setting an empty value negates the corresponding configuration) | os10 | +| ``controller.name`` | string: NSX, ovsdb | Configures the NVE controller | os10 | +| ``controller.max_backoff`` | integer | Configures max_backoff value (setting an empty value negates the corresponding configuration) | os10 | | ``controller.control_cfg`` | list | Configures the controller IP and port (see ``control_cfg.*``) | os10 | | ``control_cfg.ip_addr`` | string | Configures the controller IP | os10 | | ``control_cfg.port`` | integer | Configures the controller port | os10 | | ``control_cfg.state`` | string: absent,present\* | Removes the controller IP and port configuration if set to absent | os10 | | ``controller.state`` | string: absent,present\* | Removes the controller if set to absent | os10 | -| ``nve.state`` | string: absent,present\* | Removes the network virtualization edge if set to absent | os10 | -| ``evpn`` | dictionary | Enable the EVPN in control plane (see ``evpn.*``) | os10 | +| ``nve.state`` | string: absent,present\* | Removes the NVE if set to absent | os10 | +| ``evpn`` | dictionary | Enables EVPN in control plane (see ``evpn.*``) | os10 | | ``evpn.autoevi`` | boolean: True, False | Configures auto-EVI; no further manual configuration is allowed in auto-EVI mode | os10 | | ``evpn.rmac`` | string | Configures router MAC address | os10 | | ``evpn.evi`` | list | Configures EVPN instance (see ``evi.*``)| os10 | | ``evpn.dis_rt_asn`` | boolean | Enables/disables AS number usage in route target | os10 | -| ``evpn.vrf`` | dictionary | Enable VRF for EVPN| os10 | +| ``evpn.vrf`` | dictionary | Enables VRF for EVPN| os10 | | ``vrf.name`` | string | Configures VRF name | os10 | +| ``vrf.state`` | string(present,absent) | Configures/removes VRF for EVPN | os10 | | ``vrf.vni`` | integer | Configures VNI for the VRF | os10 | | ``vrf.rd`` | string | Configures RD for the VRF | os10 | -| ``vrf.route_target`` | dictionary | Enable route target for the VRF | os10 | -| ``route_target.type`` | string (manual, auto) | Configure the route target type | os10 | +| ``vrf.route_target`` | dictionary | Enables route target for the VRF | os10 | +| ``route_target.type`` | string (manual, auto) | Configures the route target type | os10 | | ``route_target.asn_value`` | string | Configure AS number | os10 | | ``route_target.state`` | string (present,absent) | Configures/unconfigures the route target | os10 | -| ``route_target.route_target_type`` | string | Configure the route target type | os10 | +| ``route_target.route_target_type`` | string | Configures the route target type | os10 | | ``vrf.adv_ipv4`` | dictionary | Enables IPv4 advertisement VRF | os10 | | ``adv_ipv4.type`` | string | Configures IPv4 advertisement type | os10 | -| ``adv_ipv4.rmap_name`` | string | Configures route map for advertisement | os10 | -| ``adv_ipv4.unconfig`` | boolean | Configures/unconfigures route map for advertisement | os10 | +| ``adv_ipv4.rmap_name`` | string | Configures route-map for advertisement | os10 | +| ``adv_ipv4.unconfig`` | boolean | Configures/unconfigures route-map for advertisement | os10 | | ``evi.id`` | integer | Configures the EVPN instance ID (1 to 65535) | os10 | -| ``evi.rd`` | string | Configure the route distinguisher | os10 | +| ``evi.rd`` | string | Configures the route distinguisher | os10 | | ``evi.vni`` | dictionary | Configures VNI value (see ``vni.*``) | os10 | -| ``vni.id`` | integer | Configures VNI value; configure the same VNI value that you configure for the VxLAN virtual network | os10 | +| ``vni.id`` | integer | Configures VNI value; configure the same VNI value configured for the VxLAN virtual network | os10 | | ``vni.state`` | string: absent,present\* | Removes the VNI if set to absent | os10 | | ``evi.route_target`` | list | Configures route target (see ``route_target.*``) | os10 | | ``route_target.type`` | string: manual,auto | Configures the route target (auto mode auto-configures an import and export value for EVPN routes) | os10 | -| ``route_target.asn_value`` | string | Configures the route target asn value | os10 | +| ``route_target.asn_value`` | string | Configures the route target ASN value | os10 | | ``route_target.route_target_type`` | string: import,export,both | Configures the route target type | os10 | | ``route_target.state`` | string: absent,present\* | Removes the route target if set to absent | os10 | -| ``evi.state`` | string: absent,present\* | Removes EVPN instance id if set to absent | os10 | +| ``evi.state`` | string: absent,present\* | Removes EVPN instance ID if set to absent | os10 | | ``evpn.state`` | string: absent,present\* | Removes the EVPN configuration if set to absent | os10 | | ``virtual_network`` | dictionary | Configures the virtual network attributes (see ``virtual_network.*``) | os10 | -| ``virtual_network.untagged_vlan`` | integer | Configures the reserved untagged VLAN ID, from 1 to 4093 | os10 | +| ``virtual_network.untagged_vlan`` | integer | Configures the reserved untagged VLAN ID (1 to 4093) | os10 | | ``virtual_network.virtual_net`` | list | Configures the virtual network attributes for VxLAN tunneling (see ``virtual_net.*``) | os10 | | ``virtual_net.id`` | integer | Configures a virtual network ( virtual-network ID, from 1 to 65535) | os10 | -| ``virtual_net.description`` | string | Configures the Description for Virtual Network | os10 | -| ``virtual_net.vlt_vlan_id`` | integer | Configures VLTi VLAN ID | os10 | +| ``virtual_net.description`` | string | Configures the description for virtual network | os10 | +| ``virtual_net.vlt_vlan_id`` | integer | Configures the VLTi VLAN ID | os10 | | ``virtual_net.member_interface`` | list | Configures the trunk member interface attributes to the virtual network (see ``member_interface.*``) | os10 | | ``member_interface.ifname`` | string | Configures interface name to provision the virtual network member interface | os10 | | ``member_interface.type`` | string: tagged,untagged | Configures the type to provision the virtual network member interface | os10 | | ``member_interface.vlanid`` | integer | Configures the VLAN ID to provision the virtual network member interface | os10 | | ``member_interface.state`` | string: absent,present\* | Removes the virtual network member interface if set to absent | os10 | | ``virtual_net.vxlan_vni`` | dictionary | Configures the VxLAN attributes to virtual network (see ``vxlan_vni.*``) | os10 | -| ``vxlan_vni.id`` | integer | Configures the VXLAN ID to a virtual network | os10 | +| ``vxlan_vni.id`` | integer | Configures the VxLAN ID to a virtual network | os10 | | ``vxlan_vni.remote_endpoint`` | list | Configures the IP address of a remote tunnel endpoint in a VxLAN network (see ``remote_endpoint.*``) | os10 | | ``remote_endpoint.ip`` | string | Configures the IP address of a remote tunnel endpoint (1.1.1.1) | os10 | | ``remote_endpoint.state`` | string: absent,present\* | Removes the remote tunnel endpoint in a VxLAN network if set to absent | os10 | diff --git a/roles/os10_xstp/README.md b/roles/os10_xstp/README.md index 1ad914b..0dd919b 100644 --- a/roles/os10_xstp/README.md +++ b/roles/os10_xstp/README.md @@ -2,7 +2,7 @@ This role facilitates the configuration of xSTP attributes. It supports multiple version of spanning-tree protocol (STP), rapid spanning-tree (RSTP), rapid per-VLAN spanning-tree (Rapid PVST+), multiple spanning-tree (MST), and per-VLAN spanning-tree (PVST). It supports the configuration of bridge priority, enabling and disabling spanning-tree, creating and deleting instances, and mapping virtual LAN (VLAN) to instances. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. -The xSTP role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. +The xSTP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. Role variables -------------- diff --git a/tests/integration/target-prefixes.network b/tests/integration/target-prefixes.network new file mode 100644 index 0000000..69b59b3 --- /dev/null +++ b/tests/integration/target-prefixes.network @@ -0,0 +1 @@ +os10 diff --git a/tests/integration/targets/os10_command/os10_command/defaults/main.yaml b/tests/integration/targets/os10_aaa_role/defaults/main.yaml similarity index 100% rename from tests/integration/targets/os10_command/os10_command/defaults/main.yaml rename to tests/integration/targets/os10_aaa_role/defaults/main.yaml diff --git a/tests/integration/targets/os10_aaa_role/tasks b/tests/integration/targets/os10_aaa_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_aaa_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/01_aaa_configure.j2 b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/01_aaa_configure.j2 new file mode 100644 index 0000000..aa8ad40 --- /dev/null +++ b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/01_aaa_configure.j2 @@ -0,0 +1,15 @@ +os10_aaa: + tacacs_server: + host: + - ip: 10.10.10.10 + key: 0 + value: "aaaa" + auth_port: 3 + state: present + aaa_authentication: + login: + - console: true + type: group radius group tacacs+ local + state: present + re_authenticate: false + diff --git a/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/02_aaa_update.j2 b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/02_aaa_update.j2 new file mode 100644 index 0000000..89728ab --- /dev/null +++ b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/02_aaa_update.j2 @@ -0,0 +1,24 @@ +os10_aaa: + radius_server: + retransmit: 6 + timeout: 9 + host: + - ip: 10.10.10.10 + key: 0 + value: "abc" + auth_port: 3 + state: present + tacacs_server: + host: + - ip: 10.10.10.10 + key: 0 + value: "aaaa" + auth_port: 3 + state: present + aaa_authentication: + login: + - console: true + type: group radius group tacacs+ local + state: present + re_authenticate: false + diff --git a/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/03_aaa_empty_string.j2 b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/03_aaa_empty_string.j2 new file mode 100644 index 0000000..1950e49 --- /dev/null +++ b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/03_aaa_empty_string.j2 @@ -0,0 +1,24 @@ +os10_aaa: + radius_server: + retransmit: + timeout: + host: + - ip: 10.10.10.10 + key: + value: "abc" + auth_port: + state: present + tacacs_server: + host: + - ip: 10.10.10.10 + key: 0 + value: "aaaa" + auth_port: 3 + state: present + aaa_authentication: + login: + - console: true + type: group radius group tacacs+ local + state: "absent" + re_authenticate: false + diff --git a/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/04_aaa_absent.j2 b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/04_aaa_absent.j2 new file mode 100644 index 0000000..b7a86a2 --- /dev/null +++ b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/04_aaa_absent.j2 @@ -0,0 +1,23 @@ +os10_aaa: + radius_server: + retransmit: 6 + timeout: 9 + host: + - ip: 10.10.10.10 + key: 0 + value: "abc" + auth_port: 3 + state: absent + tacacs_server: + host: + - ip: 10.10.10.10 + key: 0 + value: "aaaa" + auth_port: 3 + state: absent + aaa_authentication: + login: + - console: true + type: group radius group tacacs+ local + state: "absent" + re_authenticate: false diff --git a/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/05_aaa_stateless.j2 b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/05_aaa_stateless.j2 new file mode 100644 index 0000000..8beb9cc --- /dev/null +++ b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/05_aaa_stateless.j2 @@ -0,0 +1,20 @@ +os10_aaa: + radius_server: + retransmit: 6 + timeout: 9 + host: + - ip: 10.10.10.10 + key: 0 + value: "abc" + auth_port: 3 + tacacs_server: + host: + - ip: 10.10.10.10 + key: 0 + value: "aaaa" + auth_port: 3 + aaa_authentication: + login: + - console: true + type: group radius group tacacs+ local + re_authenticate: false diff --git a/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/teardown.j2 b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/teardown.j2 new file mode 100644 index 0000000..d9fa0fe --- /dev/null +++ b/tests/integration/targets/os10_aaa_role/templates/aaa_basic/steps/teardown.j2 @@ -0,0 +1,23 @@ +os10_aaa: + radius_server: + retransmit: + timeout: + host: + - ip: 10.10.10.10 + key: 0 + value: "abc" + auth_port: 3 + state: absent + tacacs_server: + host: + - ip: 10.10.10.10 + key: 0 + value: "aaaa" + auth_port: 3 + state: absent + aaa_authentication: + login: + - console: true + type: group radius group tacacs+ local + state: "absent" + re_authenticate: diff --git a/tests/integration/targets/os10_aaa_role/tests/aaa_basic.yaml b/tests/integration/targets/os10_aaa_role/tests/aaa_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_aaa_role/vars/main.yaml b/tests/integration/targets/os10_aaa_role/vars/main.yaml new file mode 100644 index 0000000..3e7e954 --- /dev/null +++ b/tests/integration/targets/os10_aaa_role/vars/main.yaml @@ -0,0 +1,2 @@ +test_roles: + - dellemc.os10.os10_aaa diff --git a/tests/integration/targets/os10_acl_role/defaults/main.yaml b/tests/integration/targets/os10_acl_role/defaults/main.yaml new file mode 100644 index 0000000..967b3f1 --- /dev/null +++ b/tests/integration/targets/os10_acl_role/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_idempotency: true diff --git a/tests/integration/targets/os10_acl_role/tasks b/tests/integration/targets/os10_acl_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_acl_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/01_acl_config.j2 b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/01_acl_config.j2 new file mode 100644 index 0000000..f3a5d7b --- /dev/null +++ b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/01_acl_config.j2 @@ -0,0 +1,23 @@ +idempotent: true + +os10_acl: + - name: ssh + type: ipv4 + description: acl + remark: + - description: 1 + number: 2 + state: present + entries: + - number: 14 + permit: true + protocol: tcp + source: any + src_condition: neq 6 + destination: any + dest_condition: eq 4 + other_options: count + state: present + lineterminal: + state: present + state: present diff --git a/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/02_acl_stage.j2 b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/02_acl_stage.j2 new file mode 100644 index 0000000..db65b97 --- /dev/null +++ b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/02_acl_stage.j2 @@ -0,0 +1,17 @@ +idempotent: false + +os10_acl: + - name: ssh + type: ipv4 + description: acl + stage_ingress: + - name: "{{ os10_interface_1 }}" + state: present + - name: "{{ os10_interface_2 }}" + state: present + stage_egress: + - name: "{{ os10_interface_3 }}" + state: present + lineterminal: + state: present + state: present diff --git a/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/03_acl_update.j2 b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/03_acl_update.j2 new file mode 100644 index 0000000..0d9f183 --- /dev/null +++ b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/03_acl_update.j2 @@ -0,0 +1,31 @@ +idempotent: false + +os10_acl: + - name: ssh + type: ipv4 + description: acl ssh + remark: + - description: acl remark + number: 3 + state: present + entries: + - number: 15 + permit: false + protocol: udp + source: any + src_condition: gt 4 + destination: any + dest_condition: lt 5 + other_options: fragment + state: present + stage_ingress: + - name: "{{ os10_interface_1 }}" + state: present + - name: "{{ os10_interface_2 }}" + state: present + stage_egress: + - name: "{{ os10_interface_3 }}" + state: present + lineterminal: + state: present + state: present diff --git a/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/04_acl_suboptions_absent.j2 b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/04_acl_suboptions_absent.j2 new file mode 100644 index 0000000..afa89bb --- /dev/null +++ b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/04_acl_suboptions_absent.j2 @@ -0,0 +1,30 @@ +idempotent: false +os10_acl: + - name: ssh + type: ipv4 + description: acl ssh + remark: + - description: acl remark + number: 3 + state: absent + entries: + - number: 15 + permit: false + protocol: udp + source: any + src_condition: gt 4 + destination: any + dest_condition: lt 5 + other_options: fragment + state: absent + stage_ingress: + - name: "{{ os10_interface_1 }}" + state: absent + - name: "{{ os10_interface_2 }}" + state: absent + stage_egress: + - name: "{{ os10_interface_3 }}" + state: absent + lineterminal: + state: absent + state: present diff --git a/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/05_acl_suboptions_stateless.j2 b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/05_acl_suboptions_stateless.j2 new file mode 100644 index 0000000..518758d --- /dev/null +++ b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/05_acl_suboptions_stateless.j2 @@ -0,0 +1,34 @@ +idempotent: false + +os10_acl: + - name: ssh + type: ipv4 + description: acl ssh + remark: + - description: acl remark + number: 3 + entries: + - number: 14 + permit: true + protocol: tcp + source: any + src_condition: neq 6 + destination: any + dest_condition: eq 4 + other_options: count + - number: 15 + permit: false + protocol: udp + source: any + src_condition: gt 4 + destination: any + dest_condition: lt 5 + other_options: fragment + stage_ingress: + - name: "{{ os10_interface_1 }}" + - name: "{{ os10_interface_2 }}" + stage_egress: + - name: "{{ os10_interface_3 }}" + lineterminal: + state: + state: present diff --git a/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/06_acl_absent.j2 b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/06_acl_absent.j2 new file mode 100644 index 0000000..9bce3bf --- /dev/null +++ b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/06_acl_absent.j2 @@ -0,0 +1,7 @@ +idempotent: false + +os10_acl: + - name: ssh + type: ipv4 + description: acl ssh + state: absent diff --git a/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/07_acl_stateless.j2 b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/07_acl_stateless.j2 new file mode 100644 index 0000000..9381300 --- /dev/null +++ b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/07_acl_stateless.j2 @@ -0,0 +1,24 @@ +idempotent: false +os10_acl: + - name: ssh + type: ipv4 + description: acl ssh + remark: + - description: acl remark + number: 3 + entries: + - number: 14 + permit: true + protocol: tcp + source: any + src_condition: neq 6 + destination: any + dest_condition: eq 4 + other_options: count + stage_ingress: + - name: "{{ os10_interface_1 }}" + - name: "{{ os10_interface_2 }}" + stage_egress: + - name: "{{ os10_interface_3 }}" + lineterminal: + state: diff --git a/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/teardown.j2 b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/teardown.j2 new file mode 100644 index 0000000..2fcc4b1 --- /dev/null +++ b/tests/integration/targets/os10_acl_role/templates/acl_basic/steps/teardown.j2 @@ -0,0 +1,29 @@ +os10_acl: + - name: ssh + type: ipv4 + description: acl ssh + remark: + - description: acl remark + number: 3 + state: absent + entries: + - number: 15 + permit: false + protocol: udp + source: any + src_condition: gt 4 + destination: any + dest_condition: lt 5 + other_options: fragment + state: absent + stage_ingress: + - name: "{{ os10_interface_1 }}" + state: absent + - name: "{{ os10_interface_2 }}" + state: absent + stage_egress: + - name: "{{ os10_interface_3 }}" + state: absent + lineterminal: + state: absent + state: absent diff --git a/tests/integration/targets/os10_acl_role/tests/acl_basic.yaml b/tests/integration/targets/os10_acl_role/tests/acl_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_acl_role/vars/main.yaml b/tests/integration/targets/os10_acl_role/vars/main.yaml new file mode 100644 index 0000000..b40350a --- /dev/null +++ b/tests/integration/targets/os10_acl_role/vars/main.yaml @@ -0,0 +1,5 @@ +test_roles: + - dellemc.os10.os10_acl + +idempotent_roles: + - dellemc.os10.os10_acl diff --git a/tests/integration/targets/os10_bgp_role/defaults/main.yaml b/tests/integration/targets/os10_bgp_role/defaults/main.yaml new file mode 100644 index 0000000..967b3f1 --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_idempotency: true diff --git a/tests/integration/targets/os10_bgp_role/tasks b/tests/integration/targets/os10_bgp_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/01_bgp_default_vrf_config.j2 b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/01_bgp_default_vrf_config.j2 new file mode 100644 index 0000000..947bca9 --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/01_bgp_default_vrf_config.j2 @@ -0,0 +1,191 @@ +idempotent: false +os10_bgp: + asn: 12 + router_id: 90.1.1.4 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: true + fast_ext_fallover: true + always_compare_med: true + default_loc_pref: 1000 + as_notation: asdot + enforce_first_as: true + non_deterministic_med: true + outbound_optimization: true + confederation: + identifier: 25 + peers: 23 24 + peers_state: present + route_reflector: + client_to_client: true + cluster_id: 4294967295 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + summary_only: true + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + default_metric: 10 + distance_bgp: + value: 3 4 6 + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: peer1 + type: peergroup + bfd: yes + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + address_family: + - type: ipv4 + activate: true + state: present + max_prefix: + count: 20 + threshold: 90 + warning: true + state: present + listen: + - subnet: 4.4.4.4/32 + limit: 4 + subnet_state: present + - subnet: 20::/64 + limit: 4 + subnet_state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan20 + send_community: + - type: extended + state: present + address_family: + - type: l2vpn + activate: true + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.10.1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + password: bgppassword + route_reflector_client: true + adv_start: 100 + adv_start_state: present + conn_retry_timer: 20 + remove_pri_as: present + address_family: + - type: ipv4 + activate: true + state: present + max_prefix: + count: 10 + threshold: 40 + warning: true + state: present + default_originate: + route_map: aa + state: present + distribute_list: + in: XX + in_state: present + out: YY + out_state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: true + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + sender_loop_detect: true + password: bgppassword + address_family: + - type: ipv4 + activate: true + sender_loop_detect: true + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + - type: l2vpn + activate: true + sender_loop_detect: true + state: present + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + state: present diff --git a/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/02_bgp_default_vrf_unconfig.j2 b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/02_bgp_default_vrf_unconfig.j2 new file mode 100644 index 0000000..0e4f173 --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/02_bgp_default_vrf_unconfig.j2 @@ -0,0 +1,185 @@ +idempotent: false +os10_bgp: + asn: 12 + router_id: + maxpath_ibgp: + maxpath_ebgp: + graceful_restart: false + log_neighbor_changes: false + fast_ext_fallover: false + always_compare_med: false + default_loc_pref: + as_notation: asdot + enforce_first_as: false + non_deterministic_med: false + outbound_optimization: false + confederation: + identifier: 25 + peers: 23 24 + peers_state: absent + route_reflector: + client_to_client: false + cluster_id: + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: absent + summary_only: false + dampening: + value: 15 750 2000 60 + route_map: qq + state: absent + ibgp_redist_internal: + state: absent + default_metric: + distance_bgp: + value: 3 4 6 + state: absent + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: absent + summary_only: false + ibgp_redist_internal: + state: absent + best_path: + as_path: ignore + as_path_state: absent + ignore_router_id: false + med: + - attribute: confed + state: absent + neighbor: + - type: ipv4 + interface: vlan20 + send_community: + - type: extended + state: absent + address_family: + - type: l2vpn + activate: false + state: absent + admin: up + state: absent + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.10.1 + peergroup: peer1 + peergroup_state: absent + peergroup_type: ibgp + adv_interval: 40 + fall_over: absent + password: bgppassword + route_reflector_client: false + adv_start: 100 + adv_start_state: absent + conn_retry_timer: 20 + remove_pri_as: absent + address_family: + - type: ipv4 + activate: false + state: absent + max_prefix: + count: 10 + threshold: 40 + warning: false + state: absent + default_originate: + route_map: aa + state: absent + distribute_list: + in: XX + in_state: absent + out: YY + out_state: absent + send_community: + - type: standard + state: absent + state: absent + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: false + allow_as_in: 5 + next_hop_self: false + soft_reconf: false + add_path: both 3 + route_map: + - name: qq + filter: in + state: absent + state: absent + state: absent + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: absent + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: absent + sender_loop_detect: false + password: bgppassword + address_family: + - type: ipv4 + activate: false + sender_loop_detect: false + state: absent + allow_as_in: 5 + next_hop_self: false + soft_reconf: false + - type: l2vpn + activate: false + sender_loop_detect: false + state: absent + send_community: + - type: standard + state: absent + admin: up + state: absent + - name: peer1 + type: peergroup + bfd: yes + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: absent + address_family: + - type: ipv4 + activate: false + state: absent + max_prefix: + count: 20 + threshold: 90 + warning: false + state: absent + listen: + - subnet: 4.4.4.4/32 + limit: 4 + subnet_state: absent + - subnet: 20::/64 + limit: 4 + subnet_state: absent + - name: ibgp_pg + type: peergroup + weight: 10 + state: absent + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: absent + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: absent + state: present diff --git a/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/03_bgp_non_default_vrf_config.j2 b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/03_bgp_non_default_vrf_config.j2 new file mode 100644 index 0000000..1ec5c30 --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/03_bgp_non_default_vrf_config.j2 @@ -0,0 +1,153 @@ +idempotent: false +os10_bgp: + asn: 12 + vrfs: + - name: "GREEN" + router_id: 50.1.1.1 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: true + fast_ext_fallover: true + always_compare_med: true + default_loc_pref: 1000 + route_reflector: + client_to_client: true + cluster_id: 1 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + - attribute: missing-as-worst + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: peer1 + type: peergroup + bfd: yes + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan10 + description: "U_site2 vlan" + send_community: + - type: extended + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.20.1 + name: peer1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + route_reflector_client: true + address_family: + - type: ipv4 + activate: true + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.15.3 + address_family: + - type: ipv4 + activate: true + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + address_family: + - type: ipv4 + activate: true + sender_loop_detect: true + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + - route_type: connected + route_map_name: bb + address_type: ipv4 + state: present + - route_type: l2vpn + route_map_name: cc + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + state: present + - name: "BLUE" + router_id: 6.6.6.6 + state: present + state: present diff --git a/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/04_bgp_non_default_vrf_unconfig.j2 b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/04_bgp_non_default_vrf_unconfig.j2 new file mode 100644 index 0000000..69d90ad --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/04_bgp_non_default_vrf_unconfig.j2 @@ -0,0 +1,147 @@ +idempotent: false +os10_bgp: + asn: 12 + vrfs: + - name: "GREEN" + router_id: + maxpath_ibgp: + maxpath_ebgp: + graceful_restart: false + log_neighbor_changes: false + fast_ext_fallover: false + always_compare_med: false + default_loc_pref: 1000 + route_reflector: + client_to_client: false + cluster_id: + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: absent + dampening: + value: 15 750 2000 60 + route_map: qq + state: absent + ibgp_redist_internal: + state: absent + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: absent + summary_only: false + ibgp_redist_internal: + state: absent + best_path: + as_path: ignore + as_path_state: absent + ignore_router_id: false + med: + - attribute: confed + state: absent + - attribute: missing-as-worst + state: absent + neighbor: + - type: ipv4 + interface: vlan10 + description: "U_site2 vlan" + send_community: + - type: extended + state: absent + admin: up + state: absent + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.20.1 + name: peer1 + peergroup: peer1 + peergroup_state: absent + peergroup_type: ibgp + adv_interval: 40 + fall_over: absent + route_reflector_client: false + address_family: + - type: ipv4 + activate: false + state: absent + send_community: + - type: standard + state: absent + state: absent + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.15.3 + address_family: + - type: ipv4 + activate: false + allow_as_in: 5 + next_hop_self: false + soft_reconf: false + add_path: both 3 + route_map: + - name: qq + filter: in + state: absent + state: absent + state: absent + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: absent + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: absent + address_family: + - type: ipv4 + activate: false + sender_loop_detect: false + state: absent + allow_as_in: 5 + next_hop_self: false + soft_reconf: false + send_community: + - type: standard + state: absent + admin: up + state: absent + - name: peer1 + type: peergroup + bfd: yes + state: absent + - name: ebgp_pg + type: peergroup + bfd: yes + state: absent + - name: ibgp_pg + type: peergroup + weight: 10 + state: absent + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: absent + - route_type: connected + route_map_name: bb + address_type: ipv4 + state: absent + - route_type: l2vpn + route_map_name: cc + address_type: ipv4 + state: absent + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: absent + state: present + - name: "BLUE" + router_id: + state: absent + state: present diff --git a/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/05_bgp_default_non_default_vrf_config.j2 b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/05_bgp_default_non_default_vrf_config.j2 new file mode 100644 index 0000000..cd530af --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/05_bgp_default_non_default_vrf_config.j2 @@ -0,0 +1,314 @@ +idempotent: true +os10_bgp: + asn: 12 + router_id: 90.1.1.4 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + always_compare_med: true + default_loc_pref: 1000 + as_notation: asdot + non_deterministic_med: true + outbound_optimization: true + confederation: + identifier: 25 + peers: 23 24 + peers_state: present + route_reflector: + cluster_id: 4294967295 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + summary_only: true + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + default_metric: 10 + distance_bgp: + value: 3 4 6 + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: peer1 + type: peergroup + bfd: yes + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + address_family: + - type: ipv4 + state: present + max_prefix: + count: 20 + threshold: 90 + warning: true + state: present + listen: + - subnet: 4.4.4.4/32 + limit: 4 + subnet_state: present + - subnet: 20::/64 + limit: 4 + subnet_state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan20 + send_community: + - type: extended + state: present + address_family: + - type: l2vpn + state: present + admin: up + state: present + - type: ipv4 + remote_asn: 11 + ip: 192.168.10.1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + route_reflector_client: true + adv_start: 100 + adv_start_state: present + conn_retry_timer: 20 + remove_pri_as: present + address_family: + - type: ipv4 + state: present + max_prefix: + count: 10 + threshold: 40 + warning: true + state: present + default_originate: + route_map: aa + state: present + distribute_list: + in: XX + in_state: present + out: YY + out_state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + address_family: + - type: ipv4 + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + - type: l2vpn + state: present + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + vrfs: + - name: "GREEN" + router_id: 50.1.1.1 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + always_compare_med: true + default_loc_pref: 1000 + route_reflector: + cluster_id: 1 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + - attribute: missing-as-worst + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: peer1 + type: peergroup + bfd: yes + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan10 + description: U_site2 vlan + send_community: + - type: extended + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.20.1 + name: peer1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + route_reflector_client: true + address_family: + - type: ipv4 + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.15.3 + address_family: + - type: ipv4 + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + address_family: + - type: ipv4 + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + - route_type: connected + route_map_name: bb + address_type: ipv4 + state: present + - route_type: l2vpn + route_map_name: cc + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + state: present + state: present diff --git a/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/06_bgp_default_non_default_vrf_unconfig.j2 b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/06_bgp_default_non_default_vrf_unconfig.j2 new file mode 100644 index 0000000..1fa12ee --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/06_bgp_default_non_default_vrf_unconfig.j2 @@ -0,0 +1,313 @@ +idempotent: false +os10_bgp: + asn: 12 + router_id: 90.1.1.4 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: true + always_compare_med: true + default_loc_pref: 1000 + as_notation: asdot + non_deterministic_med: true + outbound_optimization: true + confederation: + identifier: 25 + peers: 23 24 + peers_state: present + route_reflector: + cluster_id: 4294967295 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + summary_only: true + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + default_metric: 10 + distance_bgp: + value: 3 4 6 + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + neighbor: + - name: peer1 + type: peergroup + bfd: yes + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + address_family: + - type: ipv4 + state: present + max_prefix: + count: 20 + threshold: 90 + warning: true + state: present + listen: + - subnet: 4.4.4.4/32 + limit: 4 + subnet_state: present + - subnet: 20::/64 + limit: 4 + subnet_state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan20 + send_community: + - type: extended + state: present + address_family: + - type: l2vpn + activate: true + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2-spine1" + remote_asn: 11 + ip: 192.168.10.1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + password: bgppassword + route_reflector_client: true + adv_start: 100 + adv_start_state: present + conn_retry_timer: 20 + remove_pri_as: present + address_family: + - type: ipv4 + activate: true + state: present + max_prefix: + count: 10 + threshold: 40 + warning: true + state: present + default_originate: + route_map: aa + state: present + distribute_list: + in: XX + in_state: present + out: YY + out_state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: true + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + sender_loop_detect: true + password: bgppassword + address_family: + - type: ipv4 + activate: true + sender_loop_detect: true + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + - type: l2vpn + activate: true + state: present + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + vrfs: + - name: "GREEN" + router_id: 50.1.1.1 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + always_compare_med: true + default_loc_pref: 1000 + route_reflector: + cluster_id: 1 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + - attribute: missing-as-worst + state: present + neighbor: + - name: peer1 + type: peergroup + bfd: yes + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan10 + description: U_site2 vlan + send_community: + - type: extended + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.20.1 + name: peer1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + route_reflector_client: true + address_family: + - type: ipv4 + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.15.3 + address_family: + - type: ipv4 + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + address_family: + - type: ipv4 + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + - route_type: connected + route_map_name: bb + address_type: ipv4 + state: present + - route_type: l2vpn + route_map_name: cc + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + state: present + state: absent diff --git a/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/setup.j2 b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/setup.j2 new file mode 100644 index 0000000..ccf217d --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/setup.j2 @@ -0,0 +1,13 @@ +os10_vrf: + vrfdetails: + - vrf_name: GREEN + state: present + - vrf_name: BLUE + state: present +os10_vlan: + vlan 10: + description: "red" + state: present + vlan 20: + description: "yellow" + state: present diff --git a/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/teardown.j2 b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/teardown.j2 new file mode 100644 index 0000000..1c0d524 --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/templates/bgp_vrf/steps/teardown.j2 @@ -0,0 +1,13 @@ +os10_vrf: + vrfdetails: + - vrf_name: GREEN + state: absent + - vrf_name: BLUE + state: absent +os10_vlan: + vlan 10: + description: "red" + state: absent + vlan 20: + description: "yellow" + state: absent diff --git a/tests/integration/targets/os10_bgp_role/tests/bgp_vrf.yaml b/tests/integration/targets/os10_bgp_role/tests/bgp_vrf.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_bgp_role/vars/main.yaml b/tests/integration/targets/os10_bgp_role/vars/main.yaml new file mode 100644 index 0000000..6312389 --- /dev/null +++ b/tests/integration/targets/os10_bgp_role/vars/main.yaml @@ -0,0 +1,7 @@ +test_roles: + - dellemc.os10.os10_vrf + - dellemc.os10.os10_vlan + - dellemc.os10.os10_bgp + +idempotent_roles: + - dellemc.os10.os10_bgp diff --git a/tests/integration/targets/os10_config/os10_config/defaults/main.yaml b/tests/integration/targets/os10_command/defaults/main.yaml similarity index 100% rename from tests/integration/targets/os10_config/os10_config/defaults/main.yaml rename to tests/integration/targets/os10_command/defaults/main.yaml diff --git a/tests/integration/targets/os10_command/os10_command/tasks/cli.yaml b/tests/integration/targets/os10_command/tasks/cli.yaml similarity index 100% rename from tests/integration/targets/os10_command/os10_command/tasks/cli.yaml rename to tests/integration/targets/os10_command/tasks/cli.yaml diff --git a/tests/integration/targets/os10_command/os10_command/tasks/main.yaml b/tests/integration/targets/os10_command/tasks/main.yaml similarity index 100% rename from tests/integration/targets/os10_command/os10_command/tasks/main.yaml rename to tests/integration/targets/os10_command/tasks/main.yaml diff --git a/tests/integration/targets/os10_command/os10_command/tests/cli/bad_operator.yaml b/tests/integration/targets/os10_command/tests/cli/bad_operator.yaml similarity index 93% rename from tests/integration/targets/os10_command/os10_command/tests/cli/bad_operator.yaml rename to tests/integration/targets/os10_command/tests/cli/bad_operator.yaml index 1fd619b..879a3d3 100644 --- a/tests/integration/targets/os10_command/os10_command/tests/cli/bad_operator.yaml +++ b/tests/integration/targets/os10_command/tests/cli/bad_operator.yaml @@ -8,7 +8,6 @@ - show interface ethernet 1/1/1 wait_for: - "result[0] contains 'Description : blah'" - provider: "{{ cli }}" register: result ignore_errors: yes diff --git a/tests/integration/targets/os10_command/os10_command/tests/cli/contains.yaml b/tests/integration/targets/os10_command/tests/cli/contains.yaml similarity index 84% rename from tests/integration/targets/os10_command/os10_command/tests/cli/contains.yaml rename to tests/integration/targets/os10_command/tests/cli/contains.yaml index 77aac00..1aa7058 100644 --- a/tests/integration/targets/os10_command/os10_command/tests/cli/contains.yaml +++ b/tests/integration/targets/os10_command/tests/cli/contains.yaml @@ -7,9 +7,8 @@ - show version - show interface ethernet 1/1/1 wait_for: - - "result[0] contains OS10-Premium" + - "result[0] contains OS10 Enterprise" - "result[1] contains Ethernet " - provider: "{{ cli }}" register: result - assert: diff --git a/tests/integration/targets/os10_command/os10_command/tests/cli/invalid.yaml b/tests/integration/targets/os10_command/tests/cli/invalid.yaml similarity index 70% rename from tests/integration/targets/os10_command/os10_command/tests/cli/invalid.yaml rename to tests/integration/targets/os10_command/tests/cli/invalid.yaml index 6c8aefe..0eff617 100644 --- a/tests/integration/targets/os10_command/os10_command/tests/cli/invalid.yaml +++ b/tests/integration/targets/os10_command/tests/cli/invalid.yaml @@ -4,25 +4,23 @@ - name: run invalid command os10_command: commands: ['show foo'] - provider: "{{ cli }}" register: result ignore_errors: yes - assert: that: - - "'Error: Unrecognized command' in result.stdout" + - "'Error: Unrecognized command' in result.msg" - name: run commands that include invalid command os10_command: commands: - show version - show foo - provider: "{{ cli }}" register: result ignore_errors: yes - assert: that: - - "'Error: Unrecognized command' in result.stdout" + - "'Error: Unrecognized command' in result.msg" - debug: msg="END cli/invalid.yaml" diff --git a/tests/integration/targets/os10_command/os10_command/tests/cli/output.yaml b/tests/integration/targets/os10_command/tests/cli/output.yaml similarity index 91% rename from tests/integration/targets/os10_command/os10_command/tests/cli/output.yaml rename to tests/integration/targets/os10_command/tests/cli/output.yaml index 48749b2..0c85c0f 100644 --- a/tests/integration/targets/os10_command/os10_command/tests/cli/output.yaml +++ b/tests/integration/targets/os10_command/tests/cli/output.yaml @@ -4,7 +4,6 @@ - name: get output for single command os10_command: commands: ['show version'] - provider: "{{ cli }}" register: result - assert: @@ -17,7 +16,6 @@ commands: - show version - show interface Eth 1/1/1 - provider: "{{ cli }}" register: result - assert: diff --git a/tests/integration/targets/os10_command/os10_command/tests/cli/timeout.yaml b/tests/integration/targets/os10_command/tests/cli/timeout.yaml similarity index 92% rename from tests/integration/targets/os10_command/os10_command/tests/cli/timeout.yaml rename to tests/integration/targets/os10_command/tests/cli/timeout.yaml index d3da30b..65e5a82 100644 --- a/tests/integration/targets/os10_command/os10_command/tests/cli/timeout.yaml +++ b/tests/integration/targets/os10_command/tests/cli/timeout.yaml @@ -7,7 +7,6 @@ - show version wait_for: - "result[0] contains bad_value_string" - provider: "{{ cli }}" register: result ignore_errors: yes diff --git a/tests/integration/targets/os10_facts/os10_facts/defaults/main.yaml b/tests/integration/targets/os10_config/defaults/main.yaml similarity index 100% rename from tests/integration/targets/os10_facts/os10_facts/defaults/main.yaml rename to tests/integration/targets/os10_config/defaults/main.yaml diff --git a/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_block.yaml b/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_block.yaml deleted file mode 100644 index 32fe1bd..0000000 --- a/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_block.yaml +++ /dev/null @@ -1,62 +0,0 @@ ---- -- debug: msg="START cli/sublevel_block.yaml" - -- name: setup - os10_config: - lines: - - seq 5 permit ip host 192.0.2.1 any count byte - - seq 10 permit ip host 192.0.2.2 any count byte - - seq 15 permit ip host 192.0.2.3 any count byte - parents: ['ip access-list test'] - before: ['no ip access-list test'] - after: ['exit'] - provider: "{{ cli }}" - match: none - -- name: configure sub level command using block resplace - os10_config: - lines: - - seq 5 permit ip host 192.0.2.1 any count byte - - seq 10 permit ip host 192.0.2.2 any count byte - - seq 15 permit ip host 192.0.2.3 any count byte - - seq 20 permit ip host 192.0.2.4 any count byte - parents: ['ip access-list test'] - replace: block - after: ['exit'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'ip access-list test' in result.updates" - - "'seq 5 permit ip host 192.0.2.1 any count byte' in result.updates" - - "'seq 10 permit ip host 192.0.2.2 any count byte' in result.updates" - - "'seq 15 permit ip host 192.0.2.3 any count byte' in result.updates" - - "'seq 20 permit ip host 192.0.2.4 any count byte' in result.updates" - -- name: check sub level command using block replace - os10_config: - lines: - - seq 5 permit ip host 192.0.2.1 any count byte - - seq 10 permit ip host 192.0.2.2 any count byte - - seq 15 permit ip host 192.0.2.3 any count byte - - seq 20 permit ip host 192.0.2.4 any count byte - parents: ['ip access-list test'] - replace: block - after: ['exit'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - os10_config: - lines: - - no ip access-list test - match: none - provider: "{{ cli }}" - -- debug: msg="END cli/sublevel_block.yaml" diff --git a/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_exact.yaml b/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_exact.yaml deleted file mode 100644 index d4dcd8a..0000000 --- a/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_exact.yaml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- debug: msg="START cli/sublevel_exact.yaml" - -- name: setup - os10_config: - lines: - - seq 5 permit ip host 192.0.2.1 any count byte - - seq 10 permit ip host 192.0.2.2 any count byte - - seq 15 permit ip host 192.0.2.3 any count byte - - seq 20 permit ip host 192.0.2.4 any count byte - - seq 25 permit ip host 192.0.2.5 any count byte - parents: ['ip access-list test'] - before: ['no ip access-list test'] - after: ['exit'] - provider: "{{ cli }}" - match: none - -- name: configure sub level command using exact match - os10_config: - lines: - - seq 5 permit ip host 192.0.2.1 any count byte - - seq 10 permit ip host 192.0.2.2 any count byte - - seq 15 permit ip host 192.0.2.3 any count byte - - seq 20 permit ip host 192.0.2.4 any count byte - parents: ['ip access-list test'] - after: ['exit'] - match: exact - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'ip access-list test' in result.updates" - - "'seq 5 permit ip host 192.0.2.1 any count byte' in result.updates" - - "'seq 10 permit ip host 192.0.2.2 any count byte' in result.updates" - - "'seq 15 permit ip host 192.0.2.3 any count byte' in result.updates" - - "'seq 20 permit ip host 192.0.2.4 any count byte' in result.updates" - - "'seq 25 permit ip host 192.0.2.5 any count byte' not in result.updates" - -- name: check sub level command using exact match - os10_config: - lines: - - seq 5 permit ip host 192.0.2.1 any count byte - - seq 10 permit ip host 192.0.2.2 any count byte - - seq 15 permit ip host 192.0.2.3 any count byte - - seq 20 permit ip host 192.0.2.4 any count byte - - seq 25 permit ip host 192.0.2.5 any count byte - parents: ['ip access-list test'] - after: ['exit'] - match: exact - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - os10_config: - lines: - - no ip access-list test - provider: "{{ cli }}" - match: none - -- debug: msg="END cli/sublevel_exact.yaml" diff --git a/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_strict.yaml b/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_strict.yaml deleted file mode 100644 index 94c85eb..0000000 --- a/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel_strict.yaml +++ /dev/null @@ -1,63 +0,0 @@ ---- -- debug: msg="START cli/sublevel_strict.yaml" - -- name: setup - os10_config: - lines: - - seq 5 permit ip host 192.0.2.1 any count byte - - seq 10 permit ip host 192.0.2.2 any count byte - - seq 15 permit ip host 192.0.2.3 any count byte - - seq 20 permit ip host 192.0.2.4 any count byte - - seq 25 permit ip host 192.0.2.5 any count byte - parents: ['ip access-list test'] - before: ['no ip access-list test'] - after: ['exit'] - provider: "{{ cli }}" - match: none - -- name: configure sub level command using strict match - os10_config: - lines: - - seq 5 permit ip host 192.0.2.1 any count byte - - seq 10 permit ip host 192.0.2.2 any count byte - - seq 15 permit ip host 192.0.2.3 any count byte - - seq 20 permit ip host 192.0.2.4 any count byte - parents: ['ip access-list test'] - match: strict - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: check sub level command using strict match - os10_config: - lines: - - seq 5 permit ip host 192.0.2.1 any count byte - - seq 15 permit ip host 192.0.2.3 any count byte - - seq 10 permit ip host 192.0.2.2 any count byte - parents: ['ip access-list test'] - after: ['exit'] - match: strict - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'ip access-list test' in result.updates" - - "'seq 5 permit ip host 192.0.2.1 any count byte' not in result.updates" - - "'seq 10 permit ip host 192.0.2.2 any count byte' in result.updates" - - "'seq 15 permit ip host 192.0.2.3 any count byte' in result.updates" - - "'seq 20 permit ip host 192.0.2.4 any count byte' not in result.updates" - - "'seq 25 permit ip host 192.0.2.5 any count byte' not in result.updates" - -- name: teardown - os10_config: - lines: - - no ip access-list test - provider: "{{ cli }}" - match: none - -- debug: msg="END cli/sublevel_strict.yaml" diff --git a/tests/integration/targets/os10_config/os10_config/tasks/cli.yaml b/tests/integration/targets/os10_config/tasks/cli.yaml similarity index 100% rename from tests/integration/targets/os10_config/os10_config/tasks/cli.yaml rename to tests/integration/targets/os10_config/tasks/cli.yaml diff --git a/tests/integration/targets/os10_config/os10_config/tasks/main.yaml b/tests/integration/targets/os10_config/tasks/main.yaml similarity index 100% rename from tests/integration/targets/os10_config/os10_config/tasks/main.yaml rename to tests/integration/targets/os10_config/tasks/main.yaml diff --git a/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel.yaml b/tests/integration/targets/os10_config/tests/cli/sublevel.yaml similarity index 88% rename from tests/integration/targets/os10_config/os10_config/tests/cli/sublevel.yaml rename to tests/integration/targets/os10_config/tests/cli/sublevel.yaml index 2fa9951..d376e6e 100644 --- a/tests/integration/targets/os10_config/os10_config/tests/cli/sublevel.yaml +++ b/tests/integration/targets/os10_config/tests/cli/sublevel.yaml @@ -5,14 +5,12 @@ os10_config: lines: - 'no ip access-list test' - provider: "{{ cli }}" match: none - name: configure sub level command os10_config: lines: ['seq 5 permit ip any any count byte'] parents: ['ip access-list test'] - provider: "{{ cli }}" register: result - assert: @@ -25,7 +23,6 @@ os10_config: lines: ['seq 5 permit ip any any count byte'] parents: ['ip access-list test'] - provider: "{{ cli }}" register: result - assert: @@ -36,7 +33,6 @@ os10_config: lines: - 'no ip access-list test' - provider: "{{ cli }}" match: none - debug: msg="END cli/sublevel.yaml" diff --git a/tests/integration/targets/os10_config/tests/cli/sublevel_block.yaml b/tests/integration/targets/os10_config/tests/cli/sublevel_block.yaml new file mode 100644 index 0000000..ad598f2 --- /dev/null +++ b/tests/integration/targets/os10_config/tests/cli/sublevel_block.yaml @@ -0,0 +1,58 @@ +--- +- debug: msg="START cli/sublevel_block.yaml" + +- name: setup + os10_config: + lines: + - neighbor 1.1.1.1 + - neighbor 1.1.1.2 + - neighbor 1.1.1.3 + parents: ['router bgp 10'] + before: ['no router bgp'] + after: ['exit'] + match: none + +- name: configure sub level command using block resplace + os10_config: + lines: + - neighbor 1.1.1.1 + - neighbor 1.1.1.2 + - neighbor 1.1.1.3 + - neighbor 1.1.1.4 + parents: ['router bgp 10'] + replace: block + after: ['exit'] + register: result + +- assert: + that: + - "result.changed == true" + - "'router bgp 10' in result.updates" + - "'neighbor 1.1.1.1' in result.updates" + - "'neighbor 1.1.1.2' in result.updates" + - "'neighbor 1.1.1.3' in result.updates" + - "'neighbor 1.1.1.4' in result.updates" + +- name: check sub level command using block replace + os10_config: + lines: + - neighbor 1.1.1.1 + - neighbor 1.1.1.2 + - neighbor 1.1.1.3 + - neighbor 1.1.1.4 + parents: ['router bgp 10'] + replace: block + after: ['exit'] + register: result + +- assert: + that: + - "result.changed == false" + +- name: teardown + os10_config: + lines: + - no router bgp + match: none + +- debug: msg="END cli/sublevel_block.yaml" diff --git a/tests/integration/targets/os10_config/tests/cli/sublevel_exact.yaml b/tests/integration/targets/os10_config/tests/cli/sublevel_exact.yaml new file mode 100644 index 0000000..0093e4c --- /dev/null +++ b/tests/integration/targets/os10_config/tests/cli/sublevel_exact.yaml @@ -0,0 +1,62 @@ +--- +- debug: msg="START cli/sublevel_exact.yaml" + +- name: setup + os10_config: + lines: + - neighbor 1.1.1.1 + - neighbor 1.1.1.2 + - neighbor 1.1.1.3 + - neighbor 1.1.1.4 + - neighbor 1.1.1.5 + parents: ['router bgp 10'] + before: ['no router bgp'] + after: ['exit'] + match: none + +- name: configure sub level command using exact match + os10_config: + lines: + - neighbor 1.1.1.1 + - neighbor 1.1.1.2 + - neighbor 1.1.1.3 + - neighbor 1.1.1.4 + parents: ['router bgp 10'] + after: ['exit'] + match: exact + register: result + +- assert: + that: + - "result.changed == true" + - "'router bgp 10' in result.updates" + - "'neighbor 1.1.1.1' in result.updates" + - "'neighbor 1.1.1.2' in result.updates" + - "'neighbor 1.1.1.3' in result.updates" + - "'neighbor 1.1.1.4' in result.updates" + - "'neighbor 1.1.1.5' not in result.updates" + +- name: check sub level command using exact match + os10_config: + lines: + - neighbor 1.1.1.1 + - neighbor 1.1.1.2 + - neighbor 1.1.1.3 + - neighbor 1.1.1.4 + - neighbor 1.1.1.5 + parents: ['router bgp 10'] + after: ['exit'] + match: exact + register: result + +- assert: + that: + - "result.changed == false" + +- name: teardown + os10_config: + lines: + - no router bgp + match: none + +- debug: msg="END cli/sublevel_exact.yaml" diff --git a/tests/integration/targets/os10_config/tests/cli/sublevel_strict.yaml b/tests/integration/targets/os10_config/tests/cli/sublevel_strict.yaml new file mode 100644 index 0000000..3886534 --- /dev/null +++ b/tests/integration/targets/os10_config/tests/cli/sublevel_strict.yaml @@ -0,0 +1,59 @@ +--- +- debug: msg="START cli/sublevel_strict.yaml" + +- name: setup + os10_config: + lines: + - neighbor 1.1.1.1 + - neighbor 1.1.1.2 + - neighbor 1.1.1.3 + - neighbor 1.1.1.4 + - neighbor 1.1.1.5 + parents: ['router bgp 10'] + before: ['no router bgp'] + after: ['exit'] + match: none + +- name: configure sub level command using strict match + os10_config: + lines: + - neighbor 1.1.1.1 + - neighbor 1.1.1.2 + - neighbor 1.1.1.3 + - neighbor 1.1.1.4 + parents: ['router bgp 10'] + match: strict + register: result + +- assert: + that: + - "result.changed == false" + +- name: check sub level command using strict match + os10_config: + lines: + - neighbor 1.1.1.1 + - neighbor 1.1.1.3 + - neighbor 1.1.1.2 + parents: ['router bgp 10'] + after: ['exit'] + match: strict + register: result + +- assert: + that: + - "result.changed == true" + - "'router bgp 10' in result.updates" + - "'neighbor 1.1.1.1' not in result.updates" + - "'neighbor 1.1.1.2' in result.updates" + - "'neighbor 1.1.1.3' in result.updates" + - "'neighbor 1.1.1.4' not in result.updates" + - "'neighbor 1.1.1.5' not in result.updates" + +- name: teardown + os10_config: + lines: + - no router bgp + match: none + +- debug: msg="END cli/sublevel_strict.yaml" diff --git a/tests/integration/targets/os10_config/os10_config/tests/cli/toplevel.yaml b/tests/integration/targets/os10_config/tests/cli/toplevel.yaml similarity index 86% rename from tests/integration/targets/os10_config/os10_config/tests/cli/toplevel.yaml rename to tests/integration/targets/os10_config/tests/cli/toplevel.yaml index e148a46..c90037b 100644 --- a/tests/integration/targets/os10_config/os10_config/tests/cli/toplevel.yaml +++ b/tests/integration/targets/os10_config/tests/cli/toplevel.yaml @@ -4,13 +4,11 @@ - name: setup os10_config: lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" match: none - name: configure top level command os10_config: lines: ['hostname foo'] - provider: "{{ cli }}" register: result - assert: @@ -21,7 +19,6 @@ - name: configure top level command idempotent check os10_config: lines: ['hostname foo'] - provider: "{{ cli }}" register: result - assert: @@ -31,7 +28,6 @@ - name: teardown os10_config: lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" match: none - debug: msg="END cli/toplevel.yaml" diff --git a/tests/integration/targets/os10_config/os10_config/tests/cli/toplevel_after.yaml b/tests/integration/targets/os10_config/tests/cli/toplevel_after.yaml similarity index 89% rename from tests/integration/targets/os10_config/os10_config/tests/cli/toplevel_after.yaml rename to tests/integration/targets/os10_config/tests/cli/toplevel_after.yaml index 9412273..7a50790 100644 --- a/tests/integration/targets/os10_config/os10_config/tests/cli/toplevel_after.yaml +++ b/tests/integration/targets/os10_config/tests/cli/toplevel_after.yaml @@ -6,14 +6,12 @@ lines: - "snmp-server contact ansible" - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" match: none - name: configure top level command with before os10_config: lines: ['hostname foo'] after: ['snmp-server contact bar'] - provider: "{{ cli }}" register: result - assert: @@ -26,7 +24,6 @@ os10_config: lines: ['hostname foo'] after: ['snmp-server contact foo'] - provider: "{{ cli }}" register: result - assert: @@ -38,7 +35,6 @@ lines: - "no snmp-server contact" - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" match: none - debug: msg="END cli/toplevel_after.yaml" diff --git a/tests/integration/targets/os10_config/os10_config/tests/cli/toplevel_before.yaml b/tests/integration/targets/os10_config/tests/cli/toplevel_before.yaml similarity index 89% rename from tests/integration/targets/os10_config/os10_config/tests/cli/toplevel_before.yaml rename to tests/integration/targets/os10_config/tests/cli/toplevel_before.yaml index da8b604..3af72fa 100644 --- a/tests/integration/targets/os10_config/os10_config/tests/cli/toplevel_before.yaml +++ b/tests/integration/targets/os10_config/tests/cli/toplevel_before.yaml @@ -6,14 +6,12 @@ lines: - "snmp-server contact ansible" - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" match: none - name: configure top level command with before os10_config: lines: ['hostname foo'] before: ['snmp-server contact bar'] - provider: "{{ cli }}" register: result - assert: @@ -26,7 +24,6 @@ os10_config: lines: ['hostname foo'] before: ['snmp-server contact foo'] - provider: "{{ cli }}" register: result - assert: @@ -38,7 +35,6 @@ lines: - "no snmp-server contact" - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" match: none - debug: msg="END cli/toplevel_before.yaml" diff --git a/tests/integration/targets/os10_config/os10_config/tests/cli/toplevel_nonidempotent.yaml b/tests/integration/targets/os10_config/tests/cli/toplevel_nonidempotent.yaml similarity index 87% rename from tests/integration/targets/os10_config/os10_config/tests/cli/toplevel_nonidempotent.yaml rename to tests/integration/targets/os10_config/tests/cli/toplevel_nonidempotent.yaml index 03f5ade..14ee21c 100644 --- a/tests/integration/targets/os10_config/os10_config/tests/cli/toplevel_nonidempotent.yaml +++ b/tests/integration/targets/os10_config/tests/cli/toplevel_nonidempotent.yaml @@ -4,13 +4,11 @@ - name: setup os10_config: lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" match: none - name: configure top level command os10_config: lines: ['hostname foo'] - provider: "{{ cli }}" match: strict register: result @@ -22,7 +20,6 @@ - name: configure top level command idempotent check os10_config: lines: ['hostname foo'] - provider: "{{ cli }}" match: strict register: result @@ -33,7 +30,6 @@ - name: teardown os10_config: lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" match: none - debug: msg="END cli/toplevel_nonidempotent.yaml" diff --git a/tests/integration/targets/os10_ecmp_role/defaults/main.yaml b/tests/integration/targets/os10_ecmp_role/defaults/main.yaml new file mode 100644 index 0000000..967b3f1 --- /dev/null +++ b/tests/integration/targets/os10_ecmp_role/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_idempotency: true diff --git a/tests/integration/targets/os10_ecmp_role/tasks b/tests/integration/targets/os10_ecmp_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_ecmp_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/01_ecmp_configure.j2 b/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/01_ecmp_configure.j2 new file mode 100644 index 0000000..52d49ff --- /dev/null +++ b/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/01_ecmp_configure.j2 @@ -0,0 +1,4 @@ +idempotent: true +os10_ecmp: + ecmp_group_max_paths: 3 + trigger_threshold: 50 diff --git a/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/02_ecmp_update.j2 b/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/02_ecmp_update.j2 new file mode 100644 index 0000000..6c0bb03 --- /dev/null +++ b/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/02_ecmp_update.j2 @@ -0,0 +1,4 @@ +idempotent: true +os10_ecmp: + ecmp_group_max_paths: 29 + trigger_threshold: 86 diff --git a/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/03_ecmp_unconfig.j2 b/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/03_ecmp_unconfig.j2 new file mode 100644 index 0000000..0187b2c --- /dev/null +++ b/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/03_ecmp_unconfig.j2 @@ -0,0 +1,4 @@ +idempotent: false +os10_ecmp: + ecmp_group_max_paths: + trigger_threshold: diff --git a/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/teardown.j2 b/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/teardown.j2 new file mode 100644 index 0000000..d2cb816 --- /dev/null +++ b/tests/integration/targets/os10_ecmp_role/templates/ecmp_basic/steps/teardown.j2 @@ -0,0 +1,3 @@ +os10_ecmp: + ecmp_group_max_paths: + trigger_threshold: diff --git a/tests/integration/targets/os10_ecmp_role/tests/ecmp_basic.yaml b/tests/integration/targets/os10_ecmp_role/tests/ecmp_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_ecmp_role/vars/main.yaml b/tests/integration/targets/os10_ecmp_role/vars/main.yaml new file mode 100644 index 0000000..1ee0bd4 --- /dev/null +++ b/tests/integration/targets/os10_ecmp_role/vars/main.yaml @@ -0,0 +1,5 @@ +test_roles: + - dellemc.os10.os10_ecmp + +idempotent_roles: + - dellemc.os10.os10_ecmp diff --git a/tests/integration/targets/os10_facts/defaults/main.yaml b/tests/integration/targets/os10_facts/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_facts/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_facts/os10_facts/tasks/cli.yaml b/tests/integration/targets/os10_facts/tasks/cli.yaml similarity index 100% rename from tests/integration/targets/os10_facts/os10_facts/tasks/cli.yaml rename to tests/integration/targets/os10_facts/tasks/cli.yaml diff --git a/tests/integration/targets/os10_facts/os10_facts/tasks/main.yaml b/tests/integration/targets/os10_facts/tasks/main.yaml similarity index 100% rename from tests/integration/targets/os10_facts/os10_facts/tasks/main.yaml rename to tests/integration/targets/os10_facts/tasks/main.yaml diff --git a/tests/integration/targets/os10_facts/os10_facts/tests/cli/facts.yaml b/tests/integration/targets/os10_facts/tests/cli/facts.yaml similarity index 93% rename from tests/integration/targets/os10_facts/os10_facts/tests/cli/facts.yaml rename to tests/integration/targets/os10_facts/tests/cli/facts.yaml index d5b45e1..d68efad 100644 --- a/tests/integration/targets/os10_facts/os10_facts/tests/cli/facts.yaml +++ b/tests/integration/targets/os10_facts/tests/cli/facts.yaml @@ -5,7 +5,6 @@ os10_facts: gather_subset: - all - provider: "{{ cli }}" register: result - assert: @@ -22,7 +21,6 @@ os10_facts: gather_subset: - "!hardware" - provider: "{{ cli }}" register: result - assert: @@ -35,7 +33,6 @@ os10_facts: gather_subset: - interfaces - provider: "{{ cli }}" register: result - assert: diff --git a/tests/integration/targets/os10_flow_monitor_role/defaults/main.yaml b/tests/integration/targets/os10_flow_monitor_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_flow_monitor_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_flow_monitor_role/tasks b/tests/integration/targets/os10_flow_monitor_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_flow_monitor_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/01_flow_monitor_configure.j2 b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/01_flow_monitor_configure.j2 new file mode 100644 index 0000000..fb18458 --- /dev/null +++ b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/01_flow_monitor_configure.j2 @@ -0,0 +1,14 @@ +os10_flow_monitor: + session 1: + session_type: local + description: "Discription goes here" + port_match: + - interface_name: {{ os10_interface_1 }} + location: source + state: present + - interface_name: {{ os10_interface_2 }} + location: destination + state: present + flow_based: true + shutdown: up + state: present diff --git a/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/02_flow_monitory_update.j2 b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/02_flow_monitory_update.j2 new file mode 100644 index 0000000..2f20dd2 --- /dev/null +++ b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/02_flow_monitory_update.j2 @@ -0,0 +1,16 @@ +os10_flow_monitor: + session 1: + session_type: local + description: "session1 desc" + port_match: + - interface_name: {{ os10_interface_1 }} + location: source + state: present + - interface_name: {{ os10_interface_2 }} + location: destination + state: present + flow_based: true + shutdown: down + state: present + session 2: + state: present diff --git a/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/03_flow_monitor_options_default.j2 b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/03_flow_monitor_options_default.j2 new file mode 100644 index 0000000..00225e2 --- /dev/null +++ b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/03_flow_monitor_options_default.j2 @@ -0,0 +1,16 @@ +os10_flow_monitor: + session 1: + session_type: local + description: + port_match: + - interface_name: {{ os10_interface_1 }} + location: + state: present + - interface_name: {{ os10_interface_2 }} + location: destination + state: present + flow_based: + shutdown: + state: present + session 2: + state: present diff --git a/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/setup.j2 b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/setup.j2 new file mode 100644 index 0000000..c7eeeae --- /dev/null +++ b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/setup.j2 @@ -0,0 +1,3 @@ +os10_interface: + {{ os10_interface_2 }}: + switchport: false diff --git a/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/teardown.j2 b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/teardown.j2 new file mode 100644 index 0000000..94690f2 --- /dev/null +++ b/tests/integration/targets/os10_flow_monitor_role/templates/flow_monitor_basic/steps/teardown.j2 @@ -0,0 +1,23 @@ +test_roles: + - dellemc.os10.os10_flow_monitor + - dellemc.os10.os10_interface +os10_interface: + {{ os10_interface_2 }}: + switchport: true + portmode: access +os10_flow_monitor: + session 1: + session_type: local + description: "Discription goes here" + port_match: + - interface_name: {{ os10_interface_1 }} + location: source + state: absent + - interface_name: {{ os10_interface_2 }} + location: destination + state: absent + flow_based: true + shutdown: up + state: absent + session 2: + state: absent diff --git a/tests/integration/targets/os10_flow_monitor_role/tests/flow_monitor_basic.yaml b/tests/integration/targets/os10_flow_monitor_role/tests/flow_monitor_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_flow_monitor_role/vars/main.yaml b/tests/integration/targets/os10_flow_monitor_role/vars/main.yaml new file mode 100644 index 0000000..8183f28 --- /dev/null +++ b/tests/integration/targets/os10_flow_monitor_role/vars/main.yaml @@ -0,0 +1,3 @@ +test_roles: + - dellemc.os10.os10_interface + - dellemc.os10.os10_flow_monitor diff --git a/tests/integration/targets/os10_interface_role/defaults/main.yaml b/tests/integration/targets/os10_interface_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_interface_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_interface_role/tasks b/tests/integration/targets/os10_interface_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_interface_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/01_interface_config.j2 b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/01_interface_config.j2 new file mode 100644 index 0000000..bb4364d --- /dev/null +++ b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/01_interface_config.j2 @@ -0,0 +1,6 @@ +os10_interface: + {{ os10_interface_1 }}: + desc: "Connected to Core 2" + mtu: 2500 + admin: up + switchport: False diff --git a/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/02_interface_dynamic_ip.j2 b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/02_interface_dynamic_ip.j2 new file mode 100644 index 0000000..725cbde --- /dev/null +++ b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/02_interface_dynamic_ip.j2 @@ -0,0 +1,14 @@ +os10_interface: + {{ os10_interface_1 }}: + desc: "DHCP Ip" + mtu: 2500 + admin: up + switchport: False + ip_type_dynamic: True + ipv6_type_dynamic: True + {{ os10_interface_2 }}: + desc: "IPV6 Auto config" + mtu: 2000 + admin: up + switchport: False + ipv6_autoconfig: true diff --git a/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/03_interface_static_ip.j2 b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/03_interface_static_ip.j2 new file mode 100644 index 0000000..74273ab --- /dev/null +++ b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/03_interface_static_ip.j2 @@ -0,0 +1,12 @@ +os10_interface: + {{ os10_interface_1 }}: + desc: "Static Ip" + mtu: 2500 + portmode: + admin: up + switchport: False + ip_and_mask: 10.9.0.4/31 + ipv6_and_mask: 2001:4898:5809:faa2::10/126 + ipv6_autoconfig: false + ip_type_dynamic: false + ipv6_type_dynamic: false diff --git a/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/04_interface_flowcontrol.j2 b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/04_interface_flowcontrol.j2 new file mode 100644 index 0000000..c77200e --- /dev/null +++ b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/04_interface_flowcontrol.j2 @@ -0,0 +1,14 @@ +os10_interface: + {{ os10_interface_1 }}: + desc: "Static Ip" + mtu: 2500 + portmode: + admin: up + switchport: False + ip_and_mask: 10.9.0.4/31 + ipv6_and_mask: 2001:4898:5809:faa2::10/126 + ipv6_autoconfig: false + flowcontrol: + mode: "receive" + enable: "on" + state: "present" diff --git a/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/05_interface_switchport.j2 b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/05_interface_switchport.j2 new file mode 100644 index 0000000..a38709c --- /dev/null +++ b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/05_interface_switchport.j2 @@ -0,0 +1,17 @@ +os10_interface: + {{ os10_interface_3 }}: + desc: "Switch port" + mtu: 3000 + portmode: trunk + admin: up + switchport: true + {{ os10_interface_1 }}: + ip_and_mask: + ipv6_and_mask: + ipv6_autoconfig: false + state_ipv6: absent + {{ os10_interface_2 }}: + ip_and_mask: + ipv6_and_mask: + ipv6_autoconfig: false + state_ipv6: absent diff --git a/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/06_interface_vlan.j2 b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/06_interface_vlan.j2 new file mode 100644 index 0000000..ea4414d --- /dev/null +++ b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/06_interface_vlan.j2 @@ -0,0 +1,17 @@ +test_roles: + - dellemc.os10.os10_vlan + - dellemc.os10.os10_interface + +os10_vlan: + vlan 10: + state: present + +os10_interface: + vlan 10: + ip_and_mask: + ipv6_and_mask: 2001:4898:5808:ffaf::1/64 + state_ipv6: present + ip_helper: + - ip: 10.0.0.33 + state: present + admin: up diff --git a/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/07_interface_range.j2 b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/07_interface_range.j2 new file mode 100644 index 0000000..310dcd3 --- /dev/null +++ b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/07_interface_range.j2 @@ -0,0 +1,4 @@ +os10_interface: + range ethernet {{ os10_interface_1.split()[1] }},{{ os10_interface_2.split()[1] }},{{ os10_interface_3.split()[1] }}: + mtu: 2500 + admin: up diff --git a/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/teardown.j2 b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/teardown.j2 new file mode 100644 index 0000000..e51374b --- /dev/null +++ b/tests/integration/targets/os10_interface_role/templates/interface_basic/steps/teardown.j2 @@ -0,0 +1,45 @@ +test_roles: + - dellemc.os10.os10_vlan + - dellemc.os10.os10_interface + +os10_vlan: + vlan 10: + state: absent + +os10_interface: + {{ os10_interface_1 }}: + desc: + mtu: + portmode: access + admin: down + switchport: true + ip_and_mask: + ipv6_and_mask: + ip_type_dynamic: false + ipv6_type_dynamic: false + ipv6_autoconfig: false + flowcontrol: + mode: receive + enable: off + state: absent + {{ os10_interface_2 }}: + desc: + mtu: + portmode: access + admin: down + switchport: true + ip_and_mask: + ipv6_and_mask: + ip_type_dynamic: false + ipv6_type_dynamic: false + ipv6_autoconfig: false + flowcontrol: + mode: receive + enable: off + state: absent + {{ os10_interface_3 }}: + desc: + mtu: + portmode: access + admin: down + switchport: true diff --git a/tests/integration/targets/os10_interface_role/tests/interface_basic.yaml b/tests/integration/targets/os10_interface_role/tests/interface_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_interface_role/vars/main.yaml b/tests/integration/targets/os10_interface_role/vars/main.yaml new file mode 100644 index 0000000..ff3aa0e --- /dev/null +++ b/tests/integration/targets/os10_interface_role/vars/main.yaml @@ -0,0 +1,2 @@ +test_roles: + - dellemc.os10.os10_interface diff --git a/tests/integration/targets/os10_lag_role/defaults/main.yaml b/tests/integration/targets/os10_lag_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_lag_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_lag_role/tasks b/tests/integration/targets/os10_lag_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_lag_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/01_lag_configure.j2 b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/01_lag_configure.j2 new file mode 100644 index 0000000..fc74977 --- /dev/null +++ b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/01_lag_configure.j2 @@ -0,0 +1,12 @@ +os10_lag: + Po 12: + type: dynamic + min_links: 2 + max_bundle_size: 2 + lacp_system_priority: 2 + channel_members: + - port: {{ os10_interface_1 }} + mode: "active" + port_priority: 3 + lacp_rate_fast: true + state: present diff --git a/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/02_lag_update.j2 b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/02_lag_update.j2 new file mode 100644 index 0000000..e8c2338 --- /dev/null +++ b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/02_lag_update.j2 @@ -0,0 +1,12 @@ +os10_lag: + Po 12: + type: dynamic + min_links: 32 + max_bundle_size: 32 + lacp_system_priority: 5 + channel_members: + - port: {{ os10_interface_1 }} + mode: passive + port_priority: 4 + lacp_rate_fast: false + state: present diff --git a/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/03_lag_options_reset.j2 b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/03_lag_options_reset.j2 new file mode 100644 index 0000000..03d18fd --- /dev/null +++ b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/03_lag_options_reset.j2 @@ -0,0 +1,12 @@ +os10_lag: + Po 12: + type: dynamic + min_links: + max_bundle_size: + lacp_system_priority: + channel_members: + - port: {{ os10_interface_1 }} + mode: + port_priority: + lacp_rate_fast: + state: present diff --git a/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/04_lag_absent.j2 b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/04_lag_absent.j2 new file mode 100644 index 0000000..c9e7b82 --- /dev/null +++ b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/04_lag_absent.j2 @@ -0,0 +1,12 @@ +os10_lag: + Po 12: + type: dynamic + min_links: 2 + max_bundle_size: 2 + lacp_system_priority: 2 + channel_members: + - port: {{ os10_interface_1 }} + mode: "active" + port_priority: 3 + lacp_rate_fast: true + state: absent diff --git a/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/teardown.j2 b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/teardown.j2 new file mode 100644 index 0000000..09b6c3e --- /dev/null +++ b/tests/integration/targets/os10_lag_role/templates/lag_basic/steps/teardown.j2 @@ -0,0 +1,12 @@ +os10_lag: + Po 12: + type: dynamic + min_links: 2 + max_bundle_size: 2 + lacp_system_priority: + channel_members: + - port: {{ os10_interface_1 }} + mode: "active" + port_priority: 3 + lacp_rate_fast: true + state: absent diff --git a/tests/integration/targets/os10_lag_role/tests/lag_basic.yaml b/tests/integration/targets/os10_lag_role/tests/lag_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_lag_role/vars/main.yaml b/tests/integration/targets/os10_lag_role/vars/main.yaml new file mode 100644 index 0000000..4b1840f --- /dev/null +++ b/tests/integration/targets/os10_lag_role/vars/main.yaml @@ -0,0 +1,2 @@ +test_roles: + - dellemc.os10.os10_lag diff --git a/tests/integration/targets/os10_lldp_role/defaults/main.yaml b/tests/integration/targets/os10_lldp_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_lldp_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_lldp_role/tasks b/tests/integration/targets/os10_lldp_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_lldp_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/01_lldp_configure.j2 b/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/01_lldp_configure.j2 new file mode 100644 index 0000000..aa80669 --- /dev/null +++ b/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/01_lldp_configure.j2 @@ -0,0 +1,44 @@ +os10_lldp: + enable: true + multiplier: 3 + reinit: 2 + timer: 5 + advertise: + med: + fast_start_repeat_count: 4 + application: + - name: guest-voice + network_policy_id: 0 + vlan_id: 2 + vlan_type: tag + l2_priority: 3 + code_point_value: 4 + state: present + - name: voice + network_policy_id: 1 + vlan_id: 3 + vlan_type: untag + l2_priority: 3 + code_point_value: 4 + state: present + local_interface: + "{{ os10_interface_1 }}": + mode: rx + mode_state: present + advertise: + med: + enable: true + tlv: inventory + tlv_state: present + application: + - network_policy_id: 4 + state: present + tlv: + - name: basic-tlv + value: management-address port-description + state: present + - name: dcbxp-appln + value: iscsi + state: present + - name: dcbxp + state: present diff --git a/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/02_lldp_update.j2 b/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/02_lldp_update.j2 new file mode 100644 index 0000000..8b0272a --- /dev/null +++ b/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/02_lldp_update.j2 @@ -0,0 +1,44 @@ +os10_lldp: + enable: true + multiplier: 10 + reinit: 10 + timer: 15 + advertise: + med: + fast_start_repeat_count: 10 + application: + - name: guest-voice + network_policy_id: 1 + vlan_id: 5 + vlan_type: untag + l2_priority: 7 + code_point_value: 20 + state: present + - name: voice + network_policy_id: 1 + vlan_id: 3 + vlan_type: untag + l2_priority: 3 + code_point_value: 4 + state: present + local_interface: + "{{ os10_interface_1 }}": + mode: transmit + mode_state: present + advertise: + med: + enable: true + tlv: network-policy + tlv_state: present + application: + - network_policy_id: 5 + state: present + tlv: + - name: basic-tlv + value: management-address port-description + state: present + - name: dcbxp-appln + value: iscsi + state: present + - name: dcbxp + state: present diff --git a/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/03_lldp_options_absent.j2 b/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/03_lldp_options_absent.j2 new file mode 100644 index 0000000..7ded6af --- /dev/null +++ b/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/03_lldp_options_absent.j2 @@ -0,0 +1,44 @@ +os10_lldp: + enable: false + multiplier: 3 + reinit: 2 + timer: 5 + advertise: + med: + fast_start_repeat_count: 4 + application: + - name: guest-voice + network_policy_id: 0 + vlan_id: 2 + vlan_type: tag + l2_priority: 3 + code_point_value: 4 + state: present + - name: voice + network_policy_id: 1 + vlan_id: 3 + vlan_type: untag + l2_priority: 3 + code_point_value: 4 + state: absent + local_interface: + "{{ os10_interface_1 }}": + mode: rx + mode_state: present + advertise: + med: + enable: true + tlv: inventory + tlv_state: present + application: + - network_policy_id: 4 + state: absent + tlv: + - name: basic-tlv + value: management-address port-description + state: present + - name: dcbxp-appln + value: iscsi + state: present + - name: dcbxp + state: absent diff --git a/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/teardown.j2 b/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/teardown.j2 new file mode 100644 index 0000000..9f372d8 --- /dev/null +++ b/tests/integration/targets/os10_lldp_role/templates/lldp_basic/steps/teardown.j2 @@ -0,0 +1,46 @@ +os10_lldp: + enable: true + multiplier: + reinit: + timer: + advertise: + med: + fast_start_repeat_count: + application: + - name: guest-voice + network_policy_id: 0 + vlan_id: 2 + vlan_type: tag + l2_priority: 3 + code_point_value: 4 + state: absent + - name: voice + network_policy_id: 1 + vlan_id: 3 + vlan_type: untag + l2_priority: 3 + code_point_value: 4 + state: absent + local_interface: + "{{ os10_interface_1 }}": + mode: rx + mode_state: present + advertise: + med: + enable: true + tlv: inventory + tlv_state: absent + application: + - network_policy_id: 4 + state: absent + - network_policy_id: 5 + state: absent + tlv: + - name: basic-tlv + value: management-address port-description + state: present + - name: dcbxp-appln + value: iscsi + state: present + - name: dcbxp + state: present diff --git a/tests/integration/targets/os10_lldp_role/tests/lldp_basic.yaml b/tests/integration/targets/os10_lldp_role/tests/lldp_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_lldp_role/vars/main.yaml b/tests/integration/targets/os10_lldp_role/vars/main.yaml new file mode 100644 index 0000000..031311e --- /dev/null +++ b/tests/integration/targets/os10_lldp_role/vars/main.yaml @@ -0,0 +1,2 @@ +test_roles: + - dellemc.os10.os10_lldp diff --git a/tests/integration/targets/os10_logging_role/defaults/main.yaml b/tests/integration/targets/os10_logging_role/defaults/main.yaml new file mode 100644 index 0000000..967b3f1 --- /dev/null +++ b/tests/integration/targets/os10_logging_role/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_idempotency: true diff --git a/tests/integration/targets/os10_logging_role/tasks b/tests/integration/targets/os10_logging_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_logging_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/01_logging_enable.j2 b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/01_logging_enable.j2 new file mode 100644 index 0000000..75a4773 --- /dev/null +++ b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/01_logging_enable.j2 @@ -0,0 +1,6 @@ +idempotent: true +os10_logging: + console: + severity: log-err + log_file: + severity: log-err diff --git a/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/02_logging_update.j2 b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/02_logging_update.j2 new file mode 100644 index 0000000..ea10cb8 --- /dev/null +++ b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/02_logging_update.j2 @@ -0,0 +1,6 @@ +idempotent: true +os10_logging: + console: + severity: log-debug + log_file: + severity: log-debug diff --git a/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/03_logging_disable.j2 b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/03_logging_disable.j2 new file mode 100644 index 0000000..f34f7ce --- /dev/null +++ b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/03_logging_disable.j2 @@ -0,0 +1,8 @@ +idempotent: true +os10_logging: + console: + enable: false + severity: log-err + log_file: + enable: false + severity: log-err diff --git a/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/04_logging_server_add.j2 b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/04_logging_server_add.j2 new file mode 100644 index 0000000..d714efd --- /dev/null +++ b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/04_logging_server_add.j2 @@ -0,0 +1,12 @@ +idempotent: false +os10_logging: + logging: + - ip: 1.1.1.1 + state: present + console: + enable: True + severity: log-err + log_file: + enable: True + severity: log-err + source_interface: "{{ os10_interface_1 }}" diff --git a/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/05_logging_server_del.j2 b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/05_logging_server_del.j2 new file mode 100644 index 0000000..992bafa --- /dev/null +++ b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/05_logging_server_del.j2 @@ -0,0 +1,12 @@ +idempotent: false +os10_logging: + logging: + - ip: 1.1.1.1 + state: absent + console: + enable: True + severity: log-err + log_file: + enable: True + severity: log-err + source_interface: "{{ os10_interface_1 }}" diff --git a/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/teardown.j2 b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/teardown.j2 new file mode 100644 index 0000000..d8d3188 --- /dev/null +++ b/tests/integration/targets/os10_logging_role/templates/logging_basic/steps/teardown.j2 @@ -0,0 +1,11 @@ +os10_logging: + logging: + - ip: 1.1.1.1 + state: absent + console: + enable: True + severity: log-notice + log_file: + enable: True + severity: log-notice + source_interface: diff --git a/tests/integration/targets/os10_logging_role/tests/logging_basic.yaml b/tests/integration/targets/os10_logging_role/tests/logging_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_logging_role/vars/main.yaml b/tests/integration/targets/os10_logging_role/vars/main.yaml new file mode 100644 index 0000000..55afbe1 --- /dev/null +++ b/tests/integration/targets/os10_logging_role/vars/main.yaml @@ -0,0 +1,5 @@ +test_roles: + - dellemc.os10.os10_logging + +idempotent_roles: + - dellemc.os10.os10_logging diff --git a/tests/integration/targets/os10_ntp_role/defaults/main.yaml b/tests/integration/targets/os10_ntp_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_ntp_role/tasks b/tests/integration/targets/os10_ntp_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/01_ntp_configure.j2 b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/01_ntp_configure.j2 new file mode 100644 index 0000000..35d8889 --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/01_ntp_configure.j2 @@ -0,0 +1,24 @@ +os10_ntp: + source: "{{ os10_interface_1 }}" + master: 5 + authenticate: true + authentication_key: + - key_num: 123 + key_string_type: 0 + key_string: test + state: present + trusted_key: + - key_num: 1323 + state: present + server: + - ip: 2.2.2.2 + key: 345 + prefer: true + state: present + intf: + "{{ os10_interface_1 }}": + disable: true + broadcast: true + vrf: + name: red + state: present diff --git a/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/02_ntp_update.j2 b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/02_ntp_update.j2 new file mode 100644 index 0000000..f2b1118 --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/02_ntp_update.j2 @@ -0,0 +1,20 @@ +os10_ntp: + master: 4 + authenticate: false + authentication_key: + - key_num: 456 + key_string_type: 0 + key_string: ntptest + state: present + trusted_key: + - key_num: 4626 + state: present + server: + - ip: 2.2.2.2 + key: 567 + prefer: false + state: present + intf: + "{{ os10_interface_1 }}": + disable: false + broadcast: false diff --git a/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/03_ntp_suboptions_absent.j2 b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/03_ntp_suboptions_absent.j2 new file mode 100644 index 0000000..56aff6a --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/03_ntp_suboptions_absent.j2 @@ -0,0 +1,14 @@ +os10_ntp: + authentication_key: + - key_num: 456 + key_string_type: 0 + key_string: ntptest + state: absent + trusted_key: + - key_num: 4626 + state: absent + server: + - ip: 2.2.2.2 + key: 567 + prefer: false + state: absent diff --git a/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/04_ntp_suboptions_stateless.j2 b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/04_ntp_suboptions_stateless.j2 new file mode 100644 index 0000000..61c7847 --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/04_ntp_suboptions_stateless.j2 @@ -0,0 +1,11 @@ +os10_ntp: + authentication_key: + - key_num: 456 + key_string_type: 0 + key_string: ntptest + trusted_key: + - key_num: 4626 + server: + - ip: 2.2.2.2 + key: 567 + prefer: false diff --git a/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/05_ntp_empty_string.j2 b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/05_ntp_empty_string.j2 new file mode 100644 index 0000000..a232652 --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/05_ntp_empty_string.j2 @@ -0,0 +1,16 @@ +os10_ntp: + authenticate: '' + authentication_key: + - key_num: 456 + key_string_type: 0 + key_string: ntptest + trusted_key: + - key_num: 4626 + server: + - ip: 2.2.2.2 + key: 567 + prefer: '' + intf: + "{{ os10_interface_1 }}": + disable: '' + broadcast: '' diff --git a/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/setup.j2 b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/setup.j2 new file mode 100644 index 0000000..7ea26a0 --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/setup.j2 @@ -0,0 +1,4 @@ +os10_vrf: + vrfdetails: + - vrf_name: red + state: present diff --git a/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/teardown.j2 b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/teardown.j2 new file mode 100644 index 0000000..a916200 --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/templates/ntp_basic/steps/teardown.j2 @@ -0,0 +1,32 @@ +test_roles: + - dellemc.os10.os10_ntp + - dellemc.os10.os10_vrf +os10_ntp: + source: + master: + authenticate: + authentication_key: + - key_num: 123 + key_string_type: 0 + key_string: test + state: absent + trusted_key: + - key_num: 1323 + state: absent + server: + - ip: 2.2.2.2 + key: 345 + prefer: true + state: absent + intf: + "{{ os10_interface_1 }}": + disable: false + broadcast: false + vrf: + name: red + state: absent + +os10_vrf: + vrfdetails: + - vrf_name: red + state: absent diff --git a/tests/integration/targets/os10_ntp_role/tests/ntp_basic.yaml b/tests/integration/targets/os10_ntp_role/tests/ntp_basic.yaml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/tests/ntp_basic.yaml @@ -0,0 +1 @@ +--- diff --git a/tests/integration/targets/os10_ntp_role/vars/main.yaml b/tests/integration/targets/os10_ntp_role/vars/main.yaml new file mode 100644 index 0000000..b42240d --- /dev/null +++ b/tests/integration/targets/os10_ntp_role/vars/main.yaml @@ -0,0 +1,3 @@ +test_roles: + - dellemc.os10.os10_vrf + - dellemc.os10.os10_ntp diff --git a/tests/integration/targets/os10_prefix_list_role/defaults/main.yaml b/tests/integration/targets/os10_prefix_list_role/defaults/main.yaml new file mode 100644 index 0000000..967b3f1 --- /dev/null +++ b/tests/integration/targets/os10_prefix_list_role/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_idempotency: true diff --git a/tests/integration/targets/os10_prefix_list_role/tasks b/tests/integration/targets/os10_prefix_list_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_prefix_list_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/01_prefix_list_config.j2 b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/01_prefix_list_config.j2 new file mode 100644 index 0000000..4e9d912 --- /dev/null +++ b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/01_prefix_list_config.j2 @@ -0,0 +1,17 @@ +idempotent: true +os10_prefix_list: + - name: testpl + type: ipv4 + description: pl + entries: + - number: 19 + permit: true + net_num: 20.0.0.0 + mask: 16 + condition_list: + - condition: ge + prelen: 17 + - condition: le + prelen: 18 + state: present + state: present diff --git a/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/02_prefix_list_update.j2 b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/02_prefix_list_update.j2 new file mode 100644 index 0000000..3481d35 --- /dev/null +++ b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/02_prefix_list_update.j2 @@ -0,0 +1,17 @@ +idempotent: true +os10_prefix_list: + - name: testpl + type: ipv4 + description: prefixlistdesc + entries: + - number: 18 + permit: false + net_num: 20.0.0.0 + mask: 24 + condition_list: + - condition: le + prelen: 14 + - condition: ge + prelen: 13 + state: present + state: present diff --git a/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/03_prefix_list_entry_absent.j2 b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/03_prefix_list_entry_absent.j2 new file mode 100644 index 0000000..d14b8dd --- /dev/null +++ b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/03_prefix_list_entry_absent.j2 @@ -0,0 +1,17 @@ +idempotent: false +os10_prefix_list: + - name: testpl + type: ipv4 + description: pl + entries: + - number: 19 + permit: true + net_num: 20.0.0.0 + mask: 16 + condition_list: + - condition: ge + prelen: 17 + - condition: le + prelen: 18 + state: absent + state: present diff --git a/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/04_prefix_list_absent.j2 b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/04_prefix_list_absent.j2 new file mode 100644 index 0000000..b349bd9 --- /dev/null +++ b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/04_prefix_list_absent.j2 @@ -0,0 +1,16 @@ +os10_prefix_list: + - name: testpl + type: ipv4 + description: pl + entries: + - number: 19 + permit: true + net_num: 20.0.0.0 + mask: 16 + condition_list: + - condition: ge + prelen: 17 + - condition: le + prelen: 18 + state: absent + state: absent diff --git a/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/teardown.j2 b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/teardown.j2 new file mode 100644 index 0000000..b349bd9 --- /dev/null +++ b/tests/integration/targets/os10_prefix_list_role/templates/prefix_list_basic/steps/teardown.j2 @@ -0,0 +1,16 @@ +os10_prefix_list: + - name: testpl + type: ipv4 + description: pl + entries: + - number: 19 + permit: true + net_num: 20.0.0.0 + mask: 16 + condition_list: + - condition: ge + prelen: 17 + - condition: le + prelen: 18 + state: absent + state: absent diff --git a/tests/integration/targets/os10_prefix_list_role/tests/prefix_list_basic.yaml b/tests/integration/targets/os10_prefix_list_role/tests/prefix_list_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_prefix_list_role/vars/main.yaml b/tests/integration/targets/os10_prefix_list_role/vars/main.yaml new file mode 100644 index 0000000..706b6a8 --- /dev/null +++ b/tests/integration/targets/os10_prefix_list_role/vars/main.yaml @@ -0,0 +1,5 @@ +test_roles: + - dellemc.os10.os10_prefix_list + +idempotent_roles: + - dellemc.os10.os10_prefix_list diff --git a/tests/integration/targets/os10_qos_role/defaults/main.yaml b/tests/integration/targets/os10_qos_role/defaults/main.yaml new file mode 100644 index 0000000..967b3f1 --- /dev/null +++ b/tests/integration/targets/os10_qos_role/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_idempotency: true diff --git a/tests/integration/targets/os10_qos_role/tasks b/tests/integration/targets/os10_qos_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_qos_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/01_qos_config.j2 b/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/01_qos_config.j2 new file mode 100644 index 0000000..eec0f56 --- /dev/null +++ b/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/01_qos_config.j2 @@ -0,0 +1,10 @@ +idempotent: true +os10_qos: + policy_map: + - name: testpolicy + type: qos + state: present + class_map: + - name: testclas + type: qos + state: present diff --git a/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/02_qos_update.j2 b/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/02_qos_update.j2 new file mode 100644 index 0000000..ba59368 --- /dev/null +++ b/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/02_qos_update.j2 @@ -0,0 +1,10 @@ +idempotent: true +os10_qos: + policy_map: + - name: testpolicy + type: + state: present + class_map: + - name: testclas + type: + state: present diff --git a/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/03_qos_unconfig.j2 b/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/03_qos_unconfig.j2 new file mode 100644 index 0000000..3310a13 --- /dev/null +++ b/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/03_qos_unconfig.j2 @@ -0,0 +1,10 @@ +idempotent: false +os10_qos: + policy_map: + - name: testpolicy + type: + state: absent + class_map: + - name: testclas + type: + state: absent diff --git a/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/teardown.j2 b/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/teardown.j2 new file mode 100644 index 0000000..2e7960c --- /dev/null +++ b/tests/integration/targets/os10_qos_role/templates/qos_basic/steps/teardown.j2 @@ -0,0 +1,9 @@ +os10_qos: + policy_map: + - name: testpolicy + type: + state: absent + class_map: + - name: testclas + type: + state: absent diff --git a/tests/integration/targets/os10_qos_role/tests/qos_basic.yaml b/tests/integration/targets/os10_qos_role/tests/qos_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_qos_role/vars/main.yaml b/tests/integration/targets/os10_qos_role/vars/main.yaml new file mode 100644 index 0000000..9a1913c --- /dev/null +++ b/tests/integration/targets/os10_qos_role/vars/main.yaml @@ -0,0 +1,5 @@ +test_roles: + - dellemc.os10.os10_qos + +idempotent_roles: + - dellemc.os10.os10_qos diff --git a/tests/integration/targets/os10_route_map_role/defaults/main.yaml b/tests/integration/targets/os10_route_map_role/defaults/main.yaml new file mode 100644 index 0000000..967b3f1 --- /dev/null +++ b/tests/integration/targets/os10_route_map_role/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_idempotency: true diff --git a/tests/integration/targets/os10_route_map_role/tasks b/tests/integration/targets/os10_route_map_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_route_map_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/01_route_map_configure.j2 b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/01_route_map_configure.j2 new file mode 100644 index 0000000..1c0adec --- /dev/null +++ b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/01_route_map_configure.j2 @@ -0,0 +1,48 @@ +idempotent: true +os10_route_map: + as_path: + - access_list: aa + permit: true + regex: www + state: present + community_list: + - type: standard + name: qqq + permit: false + community: internet + state: present + extcommunity_list: + - type: standard + name: qqq + permit: false + community: "rt 22:33" + state: present + route_map: + - name: test + permit: true + seq_num: 1 + continue: 20 + match: + - ip_type: ipv4 + access_group: testaccess + prefix_list: testprefix + set: + local_pref: 1200 + metric_type: type-1 + metric: + 30 + origin: igp + weight: 50 + next_hop: + - type: ip + address: 10.1.1.1 + track_id: 3 + state: present + community: internet + comm_list: + add: qq + delete: qqq + extcommunity: "22:33" + extcomm_list: + add: aa + delete: aa + state: present diff --git a/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/02_route_map_update.j2 b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/02_route_map_update.j2 new file mode 100644 index 0000000..fb46439 --- /dev/null +++ b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/02_route_map_update.j2 @@ -0,0 +1,48 @@ +idempotent: true +os10_route_map: + as_path: + - access_list: aa + permit: false + regex: abc + state: present + community_list: + - type: standard + name: qqq + permit: false + regex: internet + state: present + extcommunity_list: + - type: standard + name: qqq + permit: false + community: "rt 22:35" + state: present + route_map: + - name: test + permit: false + seq_num: 5 + continue: 20 + match: + - ip_type: ipv4 + access_group: testaccess + prefix_list: testprefix + set: + local_pref: 1500 + metric_type: type-1 + metric: "- 20" + origin: egp + weight: 60 + next_hop: + - type: ip + address: 10.1.1.1 + track_id: 3 + state: present + community: no-export + comm_list: + add: commstd + delete: commex + extcommunity: "25:37" + extcomm_list: + add: commstd + delete: commex + state: present diff --git a/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/03_route_map_options_unconfig.j2 b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/03_route_map_options_unconfig.j2 new file mode 100644 index 0000000..a10c5d0 --- /dev/null +++ b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/03_route_map_options_unconfig.j2 @@ -0,0 +1,48 @@ +idempotent: false +os10_route_map: + as_path: + - access_list: aa + permit: + regex: www + state: present + community_list: + - type: standard + name: qqq + permit: + community: internet + state: present + extcommunity_list: + - type: standard + name: qqq + permit: + community: "rt 22:33" + state: present + route_map: + - name: test + permit: + seq_num: + continue: + match: + - ip_type: ipv4 + access_group: testaccess + prefix_list: testprefix + set: + local_pref: + metric_type: + metric: + origin: + weight: + next_hop: + - type: ip + address: 10.1.1.1 + track_id: 3 + state: present + community: + comm_list: + add: + delete: + extcommunity: + extcomm_list: + add: + delete: + state: present diff --git a/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/04_route_map_unconfig.j2 b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/04_route_map_unconfig.j2 new file mode 100644 index 0000000..181d882 --- /dev/null +++ b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/04_route_map_unconfig.j2 @@ -0,0 +1,47 @@ +os10_route_map: + as_path: + - access_list: aa + permit: true + regex: www + state: absent + community_list: + - type: standard + name: qqq + permit: false + community: internet + state: absent + extcommunity_list: + - type: standard + name: qqq + permit: false + community: "rt 22:33" + state: absent + route_map: + - name: test + permit: true + seq_num: 1 + continue: 20 + match: + - ip_type: ipv4 + access_group: testaccess + prefix_list: testprefix + set: + local_pref: 1200 + metric_type: type-1 + metric: + 30 + origin: igp + weight: 50 + next_hop: + - type: ip + address: 10.1.1.1 + track_id: 3 + state: absent + community: internet + comm_list: + add: qq + delete: qqq + extcommunity: "22:33" + extcomm_list: + add: aa + delete: aa + state: absent diff --git a/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/teardown.j2 b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/teardown.j2 new file mode 100644 index 0000000..e7380b3 --- /dev/null +++ b/tests/integration/targets/os10_route_map_role/templates/route_map_basic/steps/teardown.j2 @@ -0,0 +1,47 @@ +os10_route_map: + as_path: + - access_list: aa + permit: true + regex: www + state: absent + community_list: + - type: standard + name: qqq + permit: false + community: internet + state: absent + extcommunity_list: + - type: standard + name: qqq + permit: false + community: "rt 22:33" + state: absent + route_map: + - name: test + permit: true + seq_num: 1 + continue: 20 + match: + - ip_type: ipv4 + access_group: testaccess + prefix_list: testprefix + set: + local_pref: 1200 + metric_type: internal + metric: + 30 + origin: igp + weight: 50 + next_hop: + - type: ip + address: 10.1.1.1 + track_id: 3 + state: absent + community: internet + comm_list: + add: qq + delete: qqq + extcommunity: "22:33" + extcomm_list: + add: aa + delete: aa + state: absent diff --git a/tests/integration/targets/os10_route_map_role/tests/route_map_basic.yaml b/tests/integration/targets/os10_route_map_role/tests/route_map_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_route_map_role/vars/main.yaml b/tests/integration/targets/os10_route_map_role/vars/main.yaml new file mode 100644 index 0000000..8531347 --- /dev/null +++ b/tests/integration/targets/os10_route_map_role/vars/main.yaml @@ -0,0 +1,5 @@ +test_roles: + - dellemc.os10.os10_route_map + +idempotent_roles: + - dellemc.os10.os10_route_map diff --git a/tests/integration/targets/os10_snmp_role/defaults/main.yaml b/tests/integration/targets/os10_snmp_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_snmp_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_snmp_role/tasks b/tests/integration/targets/os10_snmp_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_snmp_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/01_snmp_configure.j2 b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/01_snmp_configure.j2 new file mode 100644 index 0000000..bbc9764 --- /dev/null +++ b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/01_snmp_configure.j2 @@ -0,0 +1,135 @@ +test_roles: + - dellemc.os10.os10_snmp +os10_snmp: + snmp_source_interface: mgmt 1/1/1 + snmp_location: Chennai + snmp_community: + - name: public + access_mode: ro + access_list: + name: test_acl + state: present + - name: test + access_mode: ro + access_list: + name: test_acl + state: present + state: present + snmp_traps: + - name: all + state: present + snmp_engine_id: 123456789 + snmp_remote_engine_id: + - host: 1.1.1.1 + engine_id: '0xab' + - host: 1.1.1.1 + engine_id: '0xcd' + udpport: 200 + - host: 2.1.1.1 + engine_id: '0xef' + udpport: 200 + snmp_vrf: red + snmp_group: + - name: group_1 + version: 1 + write_view: + name: view_2 + - name: group_2 + version: 2c + state: present + access_list: + name: test_acl + read_view: + name: view_1 + write_view: + name: view_2 + notify_view: + name: view_3 + - name: group_3 + version: 3 + security_level: auth + read_view: + name: view_1 + write_view: + name: view_2 + state: present + - name: group_4 + version: 3 + security_level: priv + notify_view: + name: view_1 + state: present + snmp_host: + - ip: 1.1.1.1 + communitystring: c1 + version: "2c" + udpport: 4 + state: present + - ip: 2.2.2.2 + version: 1 + communitystring: c3 + state: present + - ip: 2.1.1.1 + version: 1 + communitystring: c3 + trap_categories: + dom: true + entity: true + snmp: true + state: present + - ip: 3.1.1.1 + version: 3 + security_level: priv + security_name: test + notification_type: informs + udpport: 200 + trap_categories: + dom: true + entity: true + envmon: true + lldp: true + state: present + snmp_view: + - name: view_1 + oid_subtree: 2 + include: true + state: present + snmp_user: + - name: user_1 + group_name: group_1 + version: 3 + authentication: + localized: false + algorithm: md5 + password: 9fc53d9d908118b2804fe80e3ba8763d + encryption: + algorithm: aes + password: d0452401a8c3ce42804fe80e3ba8763d + state: present + - name: user_2 + group_name: group_1 + version: 3 + authentication: + localized: true + algorithm: md5 + password: '0x9fc53d9d908118b2804fe80e3ba8763d' + encryption: + algorithm: aes + password: '0xd0452401a8c3ce42804fe80e3ba8763d' + state: present + - name: user_3 + group_name: group_1 + version: 2c + state: present + - name: user_4 + group_name: group_1 + version: 3 + state: present + - name: user_5 + group_name: group_2 + version: 2c + remote: + ip: 1.1.1.1 + udpport: 200 + access_list: test_acl + state: present diff --git a/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/02_snmp_update.j2 b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/02_snmp_update.j2 new file mode 100644 index 0000000..8c43046 --- /dev/null +++ b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/02_snmp_update.j2 @@ -0,0 +1,144 @@ +os10_snmp: + snmp_source_interface: mgmt 1/1/1 + snmp_location: Chennai + snmp_community: + - name: public + access_mode: ro + access_list: + name: test_acl + state: absent + - name: test + access_mode: ro + access_list: + name: test_acl + state: present + state: present + snmp_traps: + - name: all + state: present + snmp_engine_id: 123456789 + snmp_remote_engine_id: + - host: 1.1.1.1 + engine_id: '0xab' + - host: 1.1.1.1 + engine_id: '0xcd' + udpport: 200 + - host: 2.1.1.1 + engine_id: '0xef' + udpport: 200 + snmp_vrf: red + snmp_group: + - name: group_1 + version: 1 + access_list: + name: test_acl + read_view: + name: view_1 + write_view: + name: view_2 + - name: group_2 + version: 2c + state: present + access_list: + name: test_acl + read_view: + name: view_1 + write_view: + name: view_2 + notify_view: + name: view_3 + state: absent + - name: group_3 + version: 3 + security_level: auth + read_view: + name: view_1 + write_view: + name: view_2 + state: present + - name: group_4 + version: 3 + security_level: priv + notify_view: + name: view_1 + state: present + read_view: + name: view_1 + write_view: + name: view_2 + state: present + snmp_host: + - ip: 1.1.1.1 + communitystring: c1 + version: "2c" + udpport: 4 + state: present + - ip: 2.2.2.2 + version: 1 + communitystring: c3 + state: present + - ip: 2.1.1.1 + version: 1 + communitystring: c3 + trap_categories: + dom: true + entity: true + snmp: true + lldp: true + state: present + - ip: 3.1.1.1 + version: 3 + security_level: priv + security_name: test + notification_type: informs + udpport: 200 + trap_categories: + dom: true + entity: true + envmon: false + lldp: false + state: present + snmp_view: + - name: view_1 + oid_subtree: 2 + include: true + state: present + snmp_user: + - name: user_1 + group_name: group_1 + version: 3 + authentication: + localized: false + algorithm: md5 + password: 9fc53d9d908118b2804fe80e3ba8763d + encryption: + algorithm: aes + password: d0452401a8c3ce42804fe80e3ba8763d + state: present + - name: user_2 + group_name: group_1 + version: 3 + authentication: + localized: true + algorithm: md5 + password: '0x9fc53d9d908118b2804fe80e3ba8763d' + encryption: + algorithm: aes + password: '0xd0452401a8c3ce42804fe80e3ba8763d' + state: present + - name: user_3 + group_name: group_1 + version: 2c + state: present + - name: user_4 + group_name: group_1 + version: 3 + state: present + - name: user_5 + group_name: group_2 + version: 2c + remote: + ip: 1.1.1.1 + udpport: 200 + access_list: test_acl + state: present diff --git a/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/03_snmp_unconfig.j2 b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/03_snmp_unconfig.j2 new file mode 100644 index 0000000..4b4a868 --- /dev/null +++ b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/03_snmp_unconfig.j2 @@ -0,0 +1,147 @@ +os10_snmp: + snmp_source_interface: mgmt 1/1/1 + snmp_location: Chennai + snmp_community: + - name: public + access_mode: ro + access_list: + name: test_acl + state: absent + - name: test + access_mode: ro + access_list: + name: test_acl + state: present + state: absent + snmp_traps: + - name: all + state: absent + snmp_engine_id: + snmp_remote_engine_id: + - host: 1.1.1.1 + engine_id: '0xab' + - host: 1.1.1.1 + engine_id: '0xcd' + udpport: 200 + - host: 2.1.1.1 + engine_id: '0xef' + udpport: 200 + state: absent + snmp_vrf: red + snmp_group: + - name: group_1 + version: 1 + access_list: + name: test_acl + read_view: + name: view_1 + write_view: + name: view_2 + - name: group_2 + version: 2c + state: present + access_list: + name: test_acl + read_view: + name: view_1 + write_view: + name: view_2 + notify_view: + name: view_3 + state: absent + - name: group_3 + version: 3 + security_level: auth + read_view: + name: view_1 + write_view: + name: view_2 + state: present + - name: group_4 + version: 3 + security_level: priv + notify_view: + name: view_1 + state: absent + read_view: + name: view_1 + state: absent + write_view: + name: view_2 + state: absent + state: absent + snmp_host: + - ip: 1.1.1.1 + communitystring: c1 + version: "2c" + udpport: 4 + state: present + - ip: 2.2.2.2 + version: 1 + communitystring: c3 + state: present + - ip: 2.1.1.1 + version: 1 + communitystring: c3 + trap_categories: + dom: true + entity: true + snmp: true + lldp: true + state: present + - ip: 3.1.1.1 + version: 3 + security_level: priv + security_name: test + notification_type: informs + udpport: 200 + trap_categories: + dom: true + entity: true + envmon: false + lldp: false + state: absent + snmp_view: + - name: view_1 + oid_subtree: 2 + include: true + state: absent + snmp_user: + - name: user_1 + group_name: group_1 + version: 3 + authentication: + localized: false + algorithm: md5 + password: 9fc53d9d908118b2804fe80e3ba8763d + encryption: + algorithm: aes + password: d0452401a8c3ce42804fe80e3ba8763d + state: present + - name: user_2 + group_name: group_1 + version: 3 + authentication: + localized: true + algorithm: md5 + password: '0x9fc53d9d908118b2804fe80e3ba8763d' + encryption: + algorithm: aes + password: '0xd0452401a8c3ce42804fe80e3ba8763d' + state: present + - name: user_3 + group_name: group_1 + version: 2c + state: absent + - name: user_4 + group_name: group_1 + version: 3 + state: absent + - name: user_5 + group_name: group_2 + version: 2c + remote: + ip: 1.1.1.1 + udpport: 200 + access_list: test_acl + state: present diff --git a/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/setup.j2 b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/setup.j2 new file mode 100644 index 0000000..7ea26a0 --- /dev/null +++ b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/setup.j2 @@ -0,0 +1,4 @@ +os10_vrf: + vrfdetails: + - vrf_name: red + state: present diff --git a/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/teardown.j2 b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/teardown.j2 new file mode 100644 index 0000000..1a3ba01 --- /dev/null +++ b/tests/integration/targets/os10_snmp_role/templates/snmp_basic/steps/teardown.j2 @@ -0,0 +1,147 @@ +test_roles: + - dellemc.os10.os10_snmp + - dellemc.os10.os10_vrf +os10_vrf: + vrfdetails: + - vrf_name: "red" + state: "absent" +os10_snmp: + snmp_source_interface: + snmp_location: + snmp_community: + - name: public + access_mode: ro + access_list: + name: test_acl + state: absent + - name: test + access_mode: ro + access_list: + name: test_acl + state: absent + state: absent + snmp_traps: + - name: all + state: absent + snmp_engine_id: + snmp_remote_engine_id: + - host: 1.1.1.1 + engine_id: '0xab' + state: absent + - host: 1.1.1.1 + engine_id: '0xcd' + udpport: 200 + state: absent + - host: 2.1.1.1 + engine_id: '0xef' + udpport: 200 + state: absent + snmp_group: + - name: group_1 + version: 1 + write_view: + name: view_2 + state: absent + - name: group_2 + version: 2c + state: present + access_list: + name: test_acl + read_view: + name: view_1 + write_view: + name: view_2 + notify_view: + name: view_3 + state: absent + - name: group_3 + version: 3 + security_level: auth + read_view: + name: view_1 + write_view: + name: view_2 + state: present + state: absent + - name: group_4 + version: 3 + security_level: priv + notify_view: + name: view_1 + state: present + state: absent + snmp_host: + - ip: 1.1.1.1 + communitystring: c1 + version: "2c" + udpport: 4 + state: absent + - ip: 2.2.2.2 + version: 1 + communitystring: c3 + state: absent + - ip: 2.1.1.1 + version: 1 + communitystring: c3 + trap_categories: + dom: true + entity: true + snmp: true + state: absent + - ip: 3.1.1.1 + version: 3 + security_level: priv + security_name: test + notification_type: informs + udpport: 200 + trap_categories: + dom: true + entity: true + envmon: true + lldp: true + state: absent + snmp_view: + - name: view_1 + oid_subtree: 2 + include: true + state: absent + snmp_vrf: + snmp_user: + - name: user_1 + group_name: group_1 + version: 3 + authentication: + localized: false + algorithm: md5 + password: 9fc53d9d908118b2804fe80e3ba8763d + encryption: + algorithm: aes + password: d0452401a8c3ce42804fe80e3ba8763d + state: absent + - name: user_2 + group_name: group_1 + version: 3 + authentication: + localized: true + algorithm: md5 + password: '0x9fc53d9d908118b2804fe80e3ba8763d' + encryption: + algorithm: aes + password: '0xd0452401a8c3ce42804fe80e3ba8763d' + state: absent + - name: user_3 + group_name: group_1 + version: 2c + state: absent + - name: user_4 + group_name: group_1 + version: 3 + state: absent + - name: user_5 + group_name: group_2 + version: 2c + remote: + ip: 1.1.1.1 + udpport: 200 + access_list: test_acl + state: absent diff --git a/tests/integration/targets/os10_snmp_role/tests/snmp_basic.yaml b/tests/integration/targets/os10_snmp_role/tests/snmp_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_snmp_role/vars/main.yaml b/tests/integration/targets/os10_snmp_role/vars/main.yaml new file mode 100644 index 0000000..0e3995a --- /dev/null +++ b/tests/integration/targets/os10_snmp_role/vars/main.yaml @@ -0,0 +1,3 @@ +test_roles: + - dellemc.os10.os10_vrf + - dellemc.os10.os10_snmp diff --git a/tests/integration/targets/os10_system_role/defaults/main.yaml b/tests/integration/targets/os10_system_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_system_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_system_role/tasks b/tests/integration/targets/os10_system_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_system_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_system_role/templates/system_basic/steps/01_system_configure.j2 b/tests/integration/targets/os10_system_role/templates/system_basic/steps/01_system_configure.j2 new file mode 100644 index 0000000..1354998 --- /dev/null +++ b/tests/integration/targets/os10_system_role/templates/system_basic/steps/01_system_configure.j2 @@ -0,0 +1,26 @@ +os10_system: + hostname: OS10 + hardware_forwarding: scaled-l3-hosts + hash_algo: + algo: + - name: lag + mode: crc + state: present + - name: ecmp + mode: xor + state: present + load_balance: + ingress_port: true + ip_selection: + - field: source-ip + state: present + ipv6_selection: + - field: source-ip + state: present + mac_selection: + - field: source-mac + state: present + tcp_udp_selection: + - field: l4-source-port + state: present + diff --git a/tests/integration/targets/os10_system_role/templates/system_basic/steps/02_system_update.j2 b/tests/integration/targets/os10_system_role/templates/system_basic/steps/02_system_update.j2 new file mode 100644 index 0000000..7263204 --- /dev/null +++ b/tests/integration/targets/os10_system_role/templates/system_basic/steps/02_system_update.j2 @@ -0,0 +1,26 @@ +os10_system: + hostname: OS10 + hardware_forwarding: scaled-l2 + hash_algo: + algo: + - name: ecmp + mode: random + state: present + - name: lag + mode: xor + state: present + load_balance: + ingress_port: true + ip_selection: + - field: destination-ip + state: present + ipv6_selection: + - field: destination-ip + state: present + mac_selection: + - field: destination-mac + state: present + tcp_udp_selection: + - field: l4-destination-port + state: present + diff --git a/tests/integration/targets/os10_system_role/templates/system_basic/steps/03_system_unconfig.j2 b/tests/integration/targets/os10_system_role/templates/system_basic/steps/03_system_unconfig.j2 new file mode 100644 index 0000000..17c84d3 --- /dev/null +++ b/tests/integration/targets/os10_system_role/templates/system_basic/steps/03_system_unconfig.j2 @@ -0,0 +1,26 @@ +os10_system: + hostname: OS10 + hardware_forwarding: + hash_algo: + algo: + - name: ecmp + mode: random + state: absent + - name: lag + mode: xor + state: present + load_balance: + ingress_port: + ip_selection: + - field: destination-ip + state: absent + ipv6_selection: + - field: destination-ip + state: absent + mac_selection: + - field: destination-mac + state: absent + tcp_udp_selection: + - field: l4-destination-port + state: absent + diff --git a/tests/integration/targets/os10_system_role/templates/system_basic/steps/teardown.j2 b/tests/integration/targets/os10_system_role/templates/system_basic/steps/teardown.j2 new file mode 100644 index 0000000..480ce11 --- /dev/null +++ b/tests/integration/targets/os10_system_role/templates/system_basic/steps/teardown.j2 @@ -0,0 +1,25 @@ +os10_system: + hostname: + hardware_forwarding: + hash_algo: + algo: + - name: ecmp + mode: random + state: absent + - name: lag + mode: xor + state: absent + load_balance: + ingress_port: + ip_selection: + - field: destination-ip + state: absent + ipv6_selection: + - field: destination-ip + state: absent + mac_selection: + - field: destination-mac + state: absent + tcp_udp_selection: + - field: l4-destination-port + state: absent diff --git a/tests/integration/targets/os10_system_role/tests/system_basic.yaml b/tests/integration/targets/os10_system_role/tests/system_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_system_role/vars/main.yaml b/tests/integration/targets/os10_system_role/vars/main.yaml new file mode 100644 index 0000000..d847941 --- /dev/null +++ b/tests/integration/targets/os10_system_role/vars/main.yaml @@ -0,0 +1,2 @@ +test_roles: + - dellemc.os10.os10_system diff --git a/tests/integration/targets/os10_uplink_role/defaults/main.yaml b/tests/integration/targets/os10_uplink_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_uplink_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_uplink_role/tasks b/tests/integration/targets/os10_uplink_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_uplink_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/01_uplink_configure.j2 b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/01_uplink_configure.j2 new file mode 100644 index 0000000..fd7a916 --- /dev/null +++ b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/01_uplink_configure.j2 @@ -0,0 +1,32 @@ +test_roles: + - dellemc.os10.os10_uplink +os10_uplink: + uplink_state_group: + - id: 1 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel1" + state: "present" + - type: "downstream" + intf: "ethernet{{ os10_interface_1.split()[1] }},{{ os10_interface_2.split()[1] }}" + state: "present" + downstream: + disable_links: all + auto_recover: false + defer_time: 50 + state: "present" + - id: 2 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel2" + state: "present" + - type: "downstream" + intf: "{{ os10_interface_3 }}" + state: "present" + downstream: + disable_links: 10 + auto_recover: true + defer_time: 50 + state: "present" diff --git a/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/02_uplink_update.j2 b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/02_uplink_update.j2 new file mode 100644 index 0000000..d412e3e --- /dev/null +++ b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/02_uplink_update.j2 @@ -0,0 +1,30 @@ +os10_uplink: + uplink_state_group: + - id: 1 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel1" + state: absent + - type: "downstream" + intf: "ethernet{{ os10_interface_1.split()[1] }},{{ os10_interface_2.split()[1] }}" + state: "present" + downstream: + disable_links: 10 + auto_recover: false + defer_time: 50 + state: "present" + - id: 2 + enable: false + uplink_type: + - type: "upstream" + intf: "port-channel2" + state: "present" + - type: "downstream" + intf: "{{ os10_interface_3 }}" + state: absent + downstream: + disable_links: 15 + auto_recover: false + defer_time: 40 + state: "present" diff --git a/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/03_uplink_absent.j2 b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/03_uplink_absent.j2 new file mode 100644 index 0000000..b2d3da0 --- /dev/null +++ b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/03_uplink_absent.j2 @@ -0,0 +1,30 @@ +os10_uplink: + uplink_state_group: + - id: 1 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel1" + state: "absent" + - type: "downstream" + intf: "ethernet{{ os10_interface_1.split()[1] }},{{ os10_interface_2.split()[1] }}" + state: "absent" + downstream: + disable_links: all + auto_recover: false + defer_time: 50 + state: "absent" + - id: 2 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel2" + state: "absent" + - type: "downstream" + intf: "{{ os10_interface_3 }}" + state: "absent" + downstream: + disable_links: 10 + auto_recover: true + defer_time: 50 + state: "absent" diff --git a/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/setup.j2 b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/setup.j2 new file mode 100644 index 0000000..2f57961 --- /dev/null +++ b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/setup.j2 @@ -0,0 +1,5 @@ +os10_lag: + Po 1: + state: present + Po 2: + state: present diff --git a/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/teardown.j2 b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/teardown.j2 new file mode 100644 index 0000000..dcd9047 --- /dev/null +++ b/tests/integration/targets/os10_uplink_role/templates/uplink_basic/steps/teardown.j2 @@ -0,0 +1,38 @@ +test_roles: + - dellemc.os10.os10_uplink + - dellemc.os10.os10_lag +os10_lag: + Po 1: + state: absent + Po 2: + state: absent +os10_uplink: + uplink_state_group: + - id: 1 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel1" + state: "absent" + - type: "downstream" + intf: "ethernet{{ os10_interface_1.split()[1] }},{{ os10_interface_2.split()[1] }}" + state: "absent" + downstream: + disable_links: all + auto_recover: false + defer_time: 50 + state: "absent" + - id: 2 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel2" + state: "absent" + - type: "downstream" + intf: "{{ os10_interface_3 }}" + state: "absent" + downstream: + disable_links: 10 + auto_recover: true + defer_time: 50 + state: "absent" diff --git a/tests/integration/targets/os10_uplink_role/tests/uplink_basic.yaml b/tests/integration/targets/os10_uplink_role/tests/uplink_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_uplink_role/vars/main.yaml b/tests/integration/targets/os10_uplink_role/vars/main.yaml new file mode 100644 index 0000000..c3d3900 --- /dev/null +++ b/tests/integration/targets/os10_uplink_role/vars/main.yaml @@ -0,0 +1,3 @@ +test_roles: + - dellemc.os10.os10_lag + - dellemc.os10.os10_uplink diff --git a/tests/integration/targets/os10_users_role/defaults/main.yaml b/tests/integration/targets/os10_users_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_users_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_users_role/tasks b/tests/integration/targets/os10_users_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_users_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_users_role/tasks_old/main.yaml b/tests/integration/targets/os10_users_role/tasks_old/main.yaml new file mode 100644 index 0000000..4de62fb --- /dev/null +++ b/tests/integration/targets/os10_users_role/tasks_old/main.yaml @@ -0,0 +1,15 @@ +--- +- name: collect all test cases + find: + paths: "{{ role_path }}/tests" + patterns: "{{ testcase }}.yaml" + register: test_cases + +- name: set test_items + set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + +- name: run test case + include: "{{ test_case_to_run }}" + with_items: "{{ test_items }}" + loop_control: + loop_var: test_case_to_run diff --git a/tests/integration/targets/os10_users_role/templates/users_basic/steps/01_users_add.j2 b/tests/integration/targets/os10_users_role/templates/users_basic/steps/01_users_add.j2 new file mode 100644 index 0000000..b53a5bb --- /dev/null +++ b/tests/integration/targets/os10_users_role/templates/users_basic/steps/01_users_add.j2 @@ -0,0 +1,9 @@ +os10_users: + - username: test + password: a1a2a3a4!@#$ + role: sysadmin + state: present + - username: u1 + password: a1a2a3a4!@#$ + role: netadmin + state: present diff --git a/tests/integration/targets/os10_users_role/templates/users_basic/steps/02_users_del.j2 b/tests/integration/targets/os10_users_role/templates/users_basic/steps/02_users_del.j2 new file mode 100644 index 0000000..abb30cf --- /dev/null +++ b/tests/integration/targets/os10_users_role/templates/users_basic/steps/02_users_del.j2 @@ -0,0 +1,5 @@ +os10_users: + - username: test + password: a1a2a3a4!@#$ + role: sysadmin + state: absent diff --git a/tests/integration/targets/os10_users_role/templates/users_basic/steps/teardown.j2 b/tests/integration/targets/os10_users_role/templates/users_basic/steps/teardown.j2 new file mode 100644 index 0000000..f817f7b --- /dev/null +++ b/tests/integration/targets/os10_users_role/templates/users_basic/steps/teardown.j2 @@ -0,0 +1,9 @@ +os10_users: + - username: test + password: a1a2a3a4!@#$ + role: sysadmin + state: absent + - username: u1 + password: a1a2a3a4!@#$ + role: netadmin + state: absent diff --git a/tests/integration/targets/os10_users_role/tests/users_basic.yaml b/tests/integration/targets/os10_users_role/tests/users_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_users_role/vars/main.yaml b/tests/integration/targets/os10_users_role/vars/main.yaml new file mode 100644 index 0000000..0a54dca --- /dev/null +++ b/tests/integration/targets/os10_users_role/vars/main.yaml @@ -0,0 +1,2 @@ +test_roles: + - dellemc.os10.os10_users diff --git a/tests/integration/targets/os10_vlan_role/defaults/main.yaml b/tests/integration/targets/os10_vlan_role/defaults/main.yaml new file mode 100644 index 0000000..967b3f1 --- /dev/null +++ b/tests/integration/targets/os10_vlan_role/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_idempotency: true diff --git a/tests/integration/targets/os10_vlan_role/tasks b/tests/integration/targets/os10_vlan_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_vlan_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/01_vlan_configure.j2 b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/01_vlan_configure.j2 new file mode 100644 index 0000000..593fb33 --- /dev/null +++ b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/01_vlan_configure.j2 @@ -0,0 +1,17 @@ +idempotent: true +os10_vlan: + vlan 100: + description: "Blue" + tagged_members: + - port: {{ os10_interface_1 }} + state: present + untagged_members: + - port: {{ os10_interface_2 }} + state: present + state: present + vlan 888: + description: "NSX_Cluster" + untagged_members: + - port: port-channel 1 + state: "present" + state: "present" diff --git a/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/02_vlan_update.j2 b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/02_vlan_update.j2 new file mode 100644 index 0000000..a2fd82f --- /dev/null +++ b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/02_vlan_update.j2 @@ -0,0 +1,19 @@ +idempotent: true +os10_vlan: + vlan 100: + description: "Blue VLAN" + tagged_members: + - port: {{ os10_interface_1 }} + state: present + - port: {{ os10_interface_3 }} + state: present + untagged_members: + - port: {{ os10_interface_2 }} + state: present + state: present + vlan 888: + description: "NSX_Cluster" + untagged_members: + - port: port-channel 1 + state: "present" + state: "present" diff --git a/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/03_vlan_member_port_range.j2 b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/03_vlan_member_port_range.j2 new file mode 100644 index 0000000..bbff49b --- /dev/null +++ b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/03_vlan_member_port_range.j2 @@ -0,0 +1,17 @@ +idempotent: false +os10_vlan: + vlan 100: + description: "Blue VLAN" + tagged_members: + - port: range ethernet {{ os10_interface_1.split()[1] }},{{ os10_interface_3.split()[1] }} + state: present + untagged_members: + - port: range {{ os10_interface_2 }} + state: present + state: present + vlan 888: + description: "NSX_Cluster" + untagged_members: + - port: port-channel 1 + state: "present" + state: "present" diff --git a/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/04_vlan_absent.j2 b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/04_vlan_absent.j2 new file mode 100644 index 0000000..2cc502d --- /dev/null +++ b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/04_vlan_absent.j2 @@ -0,0 +1,20 @@ +idempotent: false +os10_vlan: + default_vlan_id: 1 + vlan 100: + description: + tagged_members: + - port: {{ os10_interface_1 }} + state: present + - port: {{ os10_interface_3 }} + state: absent + untagged_members: + - port: {{ os10_interface_2 }} + state: present + state: present + vlan 888: + description: "NSX_Cluster" + untagged_members: + - port: port-channel 1 + state: "present" + state: absent diff --git a/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/setup.j2 b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/setup.j2 new file mode 100644 index 0000000..81cff71 --- /dev/null +++ b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/setup.j2 @@ -0,0 +1,3 @@ +os10_lag: + Po 1: + state: present diff --git a/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/teardown.j2 b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/teardown.j2 new file mode 100644 index 0000000..e640d0c --- /dev/null +++ b/tests/integration/targets/os10_vlan_role/templates/vlan_basic/steps/teardown.j2 @@ -0,0 +1,25 @@ +test_roles: + - dellemc.os10.os10_vlan + - dellemc.os10.os10_lag +os10_lag: + Po 1: + state: absent +os10_vlan: + default_vlan_id: + vlan 100: + description: + tagged_members: + - port: {{ os10_interface_1 }} + state: absent + - port: {{ os10_interface_3 }} + state: absent + untagged_members: + - port: {{ os10_interface_2 }} + state: absent + state: absent + vlan 888: + description: "NSX_Cluster" + untagged_members: + - port: port-channel 1 + state: absent + state: absent diff --git a/tests/integration/targets/os10_vlan_role/tests/vlan_basic.yaml b/tests/integration/targets/os10_vlan_role/tests/vlan_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_vlan_role/vars/main.yaml b/tests/integration/targets/os10_vlan_role/vars/main.yaml new file mode 100644 index 0000000..7acc287 --- /dev/null +++ b/tests/integration/targets/os10_vlan_role/vars/main.yaml @@ -0,0 +1,6 @@ +test_roles: + - dellemc.os10.os10_lag + - dellemc.os10.os10_vlan + +idempotent_roles: + - dellemc.os10.os10_vlan diff --git a/tests/integration/targets/os10_vlt_role/defaults/main.yaml b/tests/integration/targets/os10_vlt_role/defaults/main.yaml new file mode 100644 index 0000000..967b3f1 --- /dev/null +++ b/tests/integration/targets/os10_vlt_role/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_idempotency: true diff --git a/tests/integration/targets/os10_vlt_role/tasks b/tests/integration/targets/os10_vlt_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_vlt_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/01_vlt_configure.j2 b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/01_vlt_configure.j2 new file mode 100644 index 0000000..90ca598 --- /dev/null +++ b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/01_vlt_configure.j2 @@ -0,0 +1,15 @@ +idempotent: true +test_roles: + - dellemc.os10.os10_vlt +os10_vlt: + domain: 1 + backup_destination: "192.168.211.175" + destination_type: "ipv4" + discovery_intf: {{ os10_interface_1.split()[1] }} + discovery_intf_state: present + peer_routing: True + vlt_mac: aa:aa:aa:aa:aa:aa + vlt_peers: + Po 12: + peer_lag: 13 + state: present diff --git a/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/02_vlt_update.j2 b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/02_vlt_update.j2 new file mode 100644 index 0000000..e1406d2 --- /dev/null +++ b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/02_vlt_update.j2 @@ -0,0 +1,14 @@ +idempotent: false +os10_vlt: + domain: 1 + backup_destination: "192.168.211.175" + destination_type: "ipv4" + backup_destination_vrf: + discovery_intf: {{ os10_interface_1.split()[1] }} + discovery_intf_state: absent + peer_routing: false + vlt_mac: aa:aa:aa:aa:aa:ab + vlt_peers: + Po 12: + peer_lag: 14 + state: present diff --git a/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/03_vlt_absent.j2 b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/03_vlt_absent.j2 new file mode 100644 index 0000000..1d667cc --- /dev/null +++ b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/03_vlt_absent.j2 @@ -0,0 +1,12 @@ +os10_vlt: + domain: 1 + backup_destination: "192.168.211.175" + destination_type: "ipv4" + discovery_intf: {{ os10_interface_1.split()[1] }} + discovery_intf_state: present + peer_routing: True + vlt_mac: aa:aa:aa:aa:aa:aa + vlt_peers: + Po 12: + peer_lag: 13 + state: absent diff --git a/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/setup.j2 b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/setup.j2 new file mode 100644 index 0000000..17245d0 --- /dev/null +++ b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/setup.j2 @@ -0,0 +1,7 @@ +os10_lag: + Po 12: + state: present + +os10_interface: + {{ os10_interface_1 }}: + switchport: false diff --git a/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/teardown.j2 b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/teardown.j2 new file mode 100644 index 0000000..4460af8 --- /dev/null +++ b/tests/integration/targets/os10_vlt_role/templates/vlt_basic/steps/teardown.j2 @@ -0,0 +1,23 @@ +test_roles: + - dellemc.os10.os10_vlt + - dellemc.os10.os10_lag + - dellemc.os10.os10_interface +os10_interface: + {{ os10_interface_1 }}: + portmode: access + switchport: true +os10_lag: + Po 12: + state: absent +os10_vlt: + domain: 1 + backup_destination: "192.168.211.175" + destination_type: "ipv4" + discovery_intf: {{ os10_interface_1.split()[1] }} + discovery_intf_state: present + peer_routing: True + vlt_mac: aa:aa:aa:aa:aa:aa + vlt_peers: + Po 12: + peer_lag: 13 + state: absent diff --git a/tests/integration/targets/os10_vlt_role/tests/vlt_basic.yaml b/tests/integration/targets/os10_vlt_role/tests/vlt_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_vlt_role/vars/main.yaml b/tests/integration/targets/os10_vlt_role/vars/main.yaml new file mode 100644 index 0000000..e18e836 --- /dev/null +++ b/tests/integration/targets/os10_vlt_role/vars/main.yaml @@ -0,0 +1,7 @@ +test_roles: + - dellemc.os10.os10_interface + - dellemc.os10.os10_lag + - dellemc.os10.os10_vlt + +idempotent_roles: + - dellemc.os10.os10_vlt diff --git a/tests/integration/targets/os10_vrrp_role/defaults/main.yaml b/tests/integration/targets/os10_vrrp_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_vrrp_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_vrrp_role/tasks b/tests/integration/targets/os10_vrrp_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_vrrp_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/01_vrrp_configure.j2 b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/01_vrrp_configure.j2 new file mode 100644 index 0000000..0f95b51 --- /dev/null +++ b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/01_vrrp_configure.j2 @@ -0,0 +1,43 @@ +test_roles: + - dellemc.os10.os10_vrrp +os10_vrrp: + vrrp: + delay_reload: 2 + version: 3 + {{ os10_interface_1 }}: + vrrp_group: + - group_id: 2 + type: ipv6 + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + virtual_address: + - ip: 2001:4828:5808:ffa3::9 + state: present + - ip: 3001:4828:5808:ffa3::9 + state: present + - ip: 4001:4828:5808:ffa3::9 + state: absent + adv_interval_centisecs: 200 + state: present + - group_id: 4 + virtual_address: + - ip: 4.1.1.1 + state: present + - ip: 4.1.1.2 + state: present + - ip: 4.1.1.3 + state: absent + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + adv_interval_centisecs: 200 + state: present + vlan100: + vrrp_active_active_mode: true diff --git a/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/02_vrrp_update.j2 b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/02_vrrp_update.j2 new file mode 100644 index 0000000..b3fc61c --- /dev/null +++ b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/02_vrrp_update.j2 @@ -0,0 +1,41 @@ +os10_vrrp: + vrrp: + delay_reload: 2 + version: 3 + {{ os10_interface_1 }}: + vrrp_group: + - group_id: 2 + type: ipv6 + priority: 200 + preempt: true + track_interface: + - resource_id: 3 + priority_cost: 30 + state: present + virtual_address: + - ip: 2001:4828:5808:ffa3::9 + state: present + - ip: 3001:4828:5808:ffa3::9 + state: absent + - ip: 4001:4828:5808:ffa3::9 + state: absent + adv_interval_centisecs: 300 + state: present + - group_id: 4 + virtual_address: + - ip: 4.1.1.1 + state: present + - ip: 4.1.1.2 + state: absent + - ip: 4.1.1.3 + state: absent + priority: 140 + preempt: true + track_interface: + - resource_id: 3 + priority_cost: 20 + state: present + adv_interval_centisecs: 300 + state: present + vlan100: + vrrp_active_active_mode: false diff --git a/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/03_vrrp_options_absent.j2 b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/03_vrrp_options_absent.j2 new file mode 100644 index 0000000..f013293 --- /dev/null +++ b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/03_vrrp_options_absent.j2 @@ -0,0 +1,41 @@ +os10_vrrp: + vrrp: + delay_reload: 2 + version: 3 + {{ os10_interface_1 }}: + vrrp_group: + - group_id: 2 + type: ipv6 + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: absent + virtual_address: + - ip: 2001:4828:5808:ffa3::9 + state: present + - ip: 3001:4828:5808:ffa3::9 + state: present + - ip: 4001:4828:5808:ffa3::9 + state: absent + adv_interval_centisecs: 200 + state: present + - group_id: 4 + virtual_address: + - ip: 4.1.1.1 + state: present + - ip: 4.1.1.2 + state: present + - ip: 4.1.1.3 + state: absent + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: absent + adv_interval_centisecs: 200 + state: present + vlan100: + vrrp_active_active_mode: true diff --git a/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/04_vrrp_absent.j2 b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/04_vrrp_absent.j2 new file mode 100644 index 0000000..8e79b31 --- /dev/null +++ b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/04_vrrp_absent.j2 @@ -0,0 +1,41 @@ +os10_vrrp: + vrrp: + delay_reload: 2 + version: 3 + {{ os10_interface_1 }}: + vrrp_group: + - group_id: 2 + type: ipv6 + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + virtual_address: + - ip: 2001:4828:5808:ffa3::9 + state: present + - ip: 3001:4828:5808:ffa3::9 + state: present + - ip: 4001:4828:5808:ffa3::9 + state: absent + adv_interval_centisecs: 200 + state: absent + - group_id: 4 + virtual_address: + - ip: 4.1.1.1 + state: present + - ip: 4.1.1.2 + state: present + - ip: 4.1.1.3 + state: absent + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + adv_interval_centisecs: 200 + state: absent + vlan100: + vrrp_active_active_mode: true diff --git a/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/setup.j2 b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/setup.j2 new file mode 100644 index 0000000..dd6b16b --- /dev/null +++ b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/setup.j2 @@ -0,0 +1,3 @@ +os10_interface: + {{ os10_interface_1 }}: + switchport: false diff --git a/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/teardown.j2 b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/teardown.j2 new file mode 100644 index 0000000..2d876f5 --- /dev/null +++ b/tests/integration/targets/os10_vrrp_role/templates/vrrp_basic/steps/teardown.j2 @@ -0,0 +1,47 @@ +test_roles: + - dellemc.os10.os10_vrrp + - dellemc.os10.os10_vlan +os10_vlan: + vlan 100: + state: absent +os10_vrrp: + vrrp: + delay_reload: 0 + version: + {{ os10_interface_1 }}: + vrrp_group: + - group_id: 2 + type: ipv6 + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: absent + virtual_address: + - ip: 2001:4828:5808:ffa3::9 + state: absent + - ip: 3001:4828:5808:ffa3::9 + state: absent + - ip: 4001:4828:5808:ffa3::9 + state: absent + adv_interval_centisecs: 200 + state: absent + - group_id: 4 + virtual_address: + - ip: 4.1.1.1 + state: absent + - ip: 4.1.1.2 + state: absent + - ip: 4.1.1.3 + state: absent + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: absent + adv_interval_centisecs: 200 + state: absent + vlan100: + vrrp_active_active_mode: diff --git a/tests/integration/targets/os10_vrrp_role/tests/vrrp_basic.yaml b/tests/integration/targets/os10_vrrp_role/tests/vrrp_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_vrrp_role/vars/main.yaml b/tests/integration/targets/os10_vrrp_role/vars/main.yaml new file mode 100644 index 0000000..1eb402b --- /dev/null +++ b/tests/integration/targets/os10_vrrp_role/vars/main.yaml @@ -0,0 +1,3 @@ +test_roles: + - dellemc.os10.os10_interface + - dellemc.os10.os10_vrrp diff --git a/tests/integration/targets/os10_xstp_role/defaults/main.yaml b/tests/integration/targets/os10_xstp_role/defaults/main.yaml new file mode 100644 index 0000000..5f709c5 --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/tests/integration/targets/os10_xstp_role/tasks b/tests/integration/targets/os10_xstp_role/tasks new file mode 120000 index 0000000..f78827d --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/tasks @@ -0,0 +1 @@ +../role_test/tasks \ No newline at end of file diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/01_xstp_rstp_configure.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/01_xstp_rstp_configure.j2 new file mode 100644 index 0000000..f1a85db --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/01_xstp_rstp_configure.j2 @@ -0,0 +1,14 @@ +test_roles: + - dellemc.os10.os10_xstp +os10_xstp: + type: rstp + enable: true + path_cost: false + mac_flush_timer: 5 + rstp: + max_age: 7 + hello_time: 8 + forward_time: 9 + force_version: stp + bridge_priority: 8192 + mac_flush_threshold: 6 diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/02_xstp_rstp_defaults.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/02_xstp_rstp_defaults.j2 new file mode 100644 index 0000000..f6c324b --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/02_xstp_rstp_defaults.j2 @@ -0,0 +1,12 @@ +os10_xstp: + type: rstp + enable: true + path_cost: false + mac_flush_timer: + rstp: + max_age: + hello_time: + forward_time: + force_version: stp + bridge_priority: + mac_flush_threshold: diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/03_xstp_pvst_configure.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/03_xstp_pvst_configure.j2 new file mode 100644 index 0000000..07ed32d --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/03_xstp_pvst_configure.j2 @@ -0,0 +1,16 @@ +os10_xstp: + type: rapid-pvst + enable: true + path_cost: true + mac_flush_timer: 5 + pvst: + vlan: + - range_or_id: 10 + max_age: 10 + enable: true + hello_time: 8 + forward_time: 8 + bridge_priority: 8192 + mac_flush_threshold: 6 + root: secondary + diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/04_xstp_pvst_defaults.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/04_xstp_pvst_defaults.j2 new file mode 100644 index 0000000..8246921 --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/04_xstp_pvst_defaults.j2 @@ -0,0 +1,16 @@ +os10_xstp: + type: rapid-pvst + enable: true + path_cost: false + mac_flush_timer: + pvst: + vlan: + - range_or_id: 10 + max_age: + enable: + hello_time: + forward_time: + bridge_priority: + mac_flush_threshold: + root: + diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/05_xstp_mstp_configure.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/05_xstp_mstp_configure.j2 new file mode 100644 index 0000000..ded2976 --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/05_xstp_mstp_configure.j2 @@ -0,0 +1,24 @@ +os10_xstp: + type: mst + enable: true + path_cost: true + mac_flush_timer: 5 + mstp: + max_age: 8 + max_hops: 7 + hello_time: 8 + forward_time: 8 + force_version: stp + mstp_instances: + - number_or_range: 1 + enable: true + root: secondary + mac_flush_threshold: 8 + bridge_priority: 8192 + mst_config: + name: cfg1 + revision: 3 + cfg_list: + - number: 1 + vlans: 4,5 + vlans_state: present diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/06_xstp_mstp_defaults.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/06_xstp_mstp_defaults.j2 new file mode 100644 index 0000000..c39becd --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/06_xstp_mstp_defaults.j2 @@ -0,0 +1,24 @@ +os10_xstp: + type: mst + enable: true + path_cost: false + mac_flush_timer: + mstp: + max_age: + max_hops: + hello_time: + forward_time: + force_version: + mstp_instances: + - number_or_range: 1 + enable: + root: + mac_flush_threshold: + bridge_priority: + mst_config: + name: cfg1 + revision: + cfg_list: + - number: 1 + vlans: 4,5 + vlans_state: absent diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/07_xstp_interface_configure.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/07_xstp_interface_configure.j2 new file mode 100644 index 0000000..2ec48bc --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/07_xstp_interface_configure.j2 @@ -0,0 +1,25 @@ +os10_xstp: + type: rstp + enable: true + path_cost: true + mac_flush_timer: + intf: + {{ os10_interface_1 }}: + edge_port: true + bpdu_filter: true + bpdu_guard: true + guard: loop + enable: true + link_type: point-to-point + msti: + - instance_number: 1 + priority: 32 + cost: 1 + rstp: + priority: 32 + cost: 7 + vlan: + - range_or_id: 6 + priority: 16 + cost: 8 + diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/08_xstp_interface_defaults.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/08_xstp_interface_defaults.j2 new file mode 100644 index 0000000..b28ea45 --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/08_xstp_interface_defaults.j2 @@ -0,0 +1,25 @@ +os10_xstp: + type: rstp + enable: true + path_cost: true + mac_flush_timer: + intf: + {{ os10_interface_1 }}: + edge_port: + bpdu_filter: + bpdu_guard: + guard: + enable: false + link_type: + msti: + - instance_number: 1 + priority: + cost: + rstp: + priority: + cost: + vlan: + - range_or_id: 6 + priority: + cost: + diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/setup.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/setup.j2 new file mode 100644 index 0000000..e01f16e --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/setup.j2 @@ -0,0 +1,4 @@ +os10_interface: + {{ os10_interface_1 }}: + switchport: true + portmode: access diff --git a/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/teardown.j2 b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/teardown.j2 new file mode 100644 index 0000000..e1e5ffa --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/templates/xstp_basic/steps/teardown.j2 @@ -0,0 +1,60 @@ +os10_xstp: + type: + enable: true + path_cost: false + mac_flush_timer: + rstp: + max_age: + hello_time: + forward_time: + force_version: + bridge_priority: + mac_flush_threshold: + pvst: + vlan: + - range_or_id: 10 + max_age: + enable: true + hello_time: + forward_time: + bridge_priority: + mac_flush_threshold: + root: + mstp: + max_age: + max_hops: + hello_time: + forward_time: + force_version: + mstp_instances: + - number_or_range: 1 + enable: true + root: + mac_flush_threshold: + bridge_priority: + mst_config: + name: + revision: + cfg_list: + - number: 1 + vlans: 4,5 + vlans_state: absent + intf: + {{ os10_interface_1 }}: + edge_port: + bpdu_filter: + bpdu_guard: + guard: + enable: true + link_type: + msti: + - instance_number: 1 + priority: + cost: + rstp: + priority: + cost: + vlan: + - range_or_id: 6 + priority: + cost: diff --git a/tests/integration/targets/os10_xstp_role/tests/xstp_basic.yaml b/tests/integration/targets/os10_xstp_role/tests/xstp_basic.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/targets/os10_xstp_role/vars/main.yaml b/tests/integration/targets/os10_xstp_role/vars/main.yaml new file mode 100644 index 0000000..001043c --- /dev/null +++ b/tests/integration/targets/os10_xstp_role/vars/main.yaml @@ -0,0 +1,3 @@ +test_roles: + - dellemc.os10.os10_interface + - dellemc.os10.os10_xstp diff --git a/tests/integration/targets/role_test/tasks/main.yaml b/tests/integration/targets/role_test/tasks/main.yaml new file mode 100644 index 0000000..88be0f2 --- /dev/null +++ b/tests/integration/targets/role_test/tasks/main.yaml @@ -0,0 +1,3 @@ +--- +- { include: prepare_test_facts.yaml, tags: ['role']} +- { include: tests.yaml, tags: ['role']} diff --git a/tests/integration/targets/role_test/tasks/prepare_test_facts.yaml b/tests/integration/targets/role_test/tasks/prepare_test_facts.yaml new file mode 100644 index 0000000..a86b71f --- /dev/null +++ b/tests/integration/targets/role_test/tasks/prepare_test_facts.yaml @@ -0,0 +1,14 @@ +--- +- block: + - name: Collect interface list + import_role: + name: os10_template + tasks_from: show_ip_interface_brief.yaml + register: result + - name: Set interface list + set_fact: + os10_interface_1: "{{ ip_interface_facts[0].INTERFACE_NAME | lower }}" + os10_interface_2: "{{ ip_interface_facts[1].INTERFACE_NAME | lower }}" + os10_interface_3: "{{ ip_interface_facts[2].INTERFACE_NAME | lower }}" + + when: prepare_os10_role_tests_task | default(True) | bool diff --git a/tests/integration/targets/role_test/tasks/testcase/include_os10_role.yaml b/tests/integration/targets/role_test/tasks/testcase/include_os10_role.yaml new file mode 100644 index 0000000..395d2fe --- /dev/null +++ b/tests/integration/targets/role_test/tasks/testcase/include_os10_role.yaml @@ -0,0 +1,20 @@ +- include_role: + name: "{{ os10_role_name }}" + +- debug: msg="Role completed {{ os10_role_name }}" + notify: "os10_role completed" + +- block: + - name: "Testing idempotency for {{ os10_role_name }}" + include_role: + name: "{{ os10_role_name }}" + - name: "idempotency result for {{ os10_role_name }}" + fail: + msg: "idempotency test failed for {{ os10_role_name }}" + when: output.changed + + when: > + ( test_idempotency is defined and test_idempotency and + idempotent_roles is defined and os10_role_name in idempotent_roles and + idempotent is defined and idempotent + ) diff --git a/tests/integration/targets/role_test/tasks/testcase/run_test_case.yaml b/tests/integration/targets/role_test/tasks/testcase/run_test_case.yaml new file mode 100644 index 0000000..c84b103 --- /dev/null +++ b/tests/integration/targets/role_test/tasks/testcase/run_test_case.yaml @@ -0,0 +1,62 @@ +- name: set test case + set_fact: + role_testcase: "{{ role_testcase_path | basename | splitext | first }}" + +- name: set test case output dir + set_fact: + testcase_outdir: "{{ output_dir }}/{{ role_name }}/{{ role_testcase_path }}" + + +- name: Prepare testcase output dir + file: + path: "{{ testcase_outdir }}" + state: directory + +- name: Source testcase variables + include_vars: "{{ item }}" + vars: + params: + files: + - "{{ role_testcase }}.yaml" + paths: + - "vars" + loop: "{{ query('first_found', params, errors='ignore') }}" + +- name: Include Testcase tasks + include: "{{ role_testcase_path }}" + +- name: Identifying steps + block: + - name: Identifying steps + find: + paths: "{{ role_path }}/templates/{{ role_testcase }}/steps" + patterns: "*.j2" + register: step_files + - set_fact: teststeps_files="{{ step_files.files | map(attribute='path') | map('basename') | list }}" + - set_fact: teststeps="{{ teststeps_files | map('splitext') | map('first') | reject('equalto', 'setup') | reject('equalto', 'teardown') | list | sort }}" + when: teststeps is not defined + +- name: Check if setup step exists + stat: path="{{ role_path }}/templates/{{ role_testcase }}/steps/setup.j2" + ignore_errors: true + register: setup_template + +- name: Setup Testcase + include: testcase/run_test_step.yaml role_teststep=setup idempotent=false + when: setup_template.stat.exists == true + +- name: Run Test Steps + block: + - name: Run Test Steps + include: testcase/run_test_step.yaml idempotent=false + with_items: "{{ teststeps }}" + loop_control: + loop_var: role_teststep + always: + - name: Check teardown + stat: path="{{ role_path }}/templates/{{ role_testcase }}/steps/teardown.j2" + ignore_errors: true + register: teardown_template + - name: Run teardown + include: testcase/run_test_step.yaml role_teststep=teardown idempotent=false + when: teardown_template.stat.exists == true diff --git a/tests/integration/targets/role_test/tasks/testcase/run_test_step.yaml b/tests/integration/targets/role_test/tasks/testcase/run_test_step.yaml new file mode 100644 index 0000000..624325e --- /dev/null +++ b/tests/integration/targets/role_test/tasks/testcase/run_test_step.yaml @@ -0,0 +1,26 @@ +--- +- name: Running step {{ role_teststep }} + debug: msg="{{ role_teststep }}" + +- name: Set step vars file + set_fact: + teststep_var_template: "{{ role_testcase }}/steps/{{ role_teststep }}.j2" + teststep_vars_file: "{{ testcase_outdir }}/{{ role_teststep }}.yaml" + +- name: Preparing step variables + template: + src: "{{ teststep_var_template }}" + dest: "{{ teststep_vars_file }}" + +- name: Load step variables + include_vars: + file: "{{ teststep_vars_file }}" + +- name: Including roles for the step + include: testcase/include_os10_role.yaml os10_role_name="{{ step_role }}" + # include_role: + # name: "{{ step_role }}" + with_items: "{{ test_roles }}" + loop_control: + loop_var: step_role + when: test_roles is defined diff --git a/tests/integration/targets/role_test/tasks/tests.yaml b/tests/integration/targets/role_test/tasks/tests.yaml new file mode 100644 index 0000000..572c253 --- /dev/null +++ b/tests/integration/targets/role_test/tasks/tests.yaml @@ -0,0 +1,14 @@ +- name: collect all test cases + find: + paths: "{{ role_path }}/tests" + patterns: "{{ testcase }}.yaml" + register: test_cases + +- name: set test_items + set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + +- name: run test case + include: testcase/run_test_case.yaml + with_items: "{{ test_items }}" + loop_control: + loop_var: role_testcase_path diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index d9c7ccd..7e081d7 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -8,3 +8,10 @@ plugins/modules/show_system_network_summary.py validate-modules:parameter-list-n plugins/modules/os10_config.py validate-modules:parameter-list-no-elements plugins/modules/os10_facts.py validate-modules:parameter-list-no-elements plugins/modules/os10_command.py validate-modules:parameter-list-no-elements +plugins/module_utils/network/base_network_show.py import-2.6 +plugins/modules/base_xml_to_dict.py import-2.6 +plugins/modules/bgp_validate.py import-2.6 +plugins/modules/mtu_validate.py import-2.6 +plugins/modules/show_system_network_summary.py import-2.6 +plugins/modules/vlt_validate.py import-2.6 +plugins/modules/wiring_validate.py import-2.6