-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from cisco-open/fr/feature_templates
Fr: Feature & Device templates
- Loading branch information
Showing
68 changed files
with
12,621 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace: cisco | ||
name: catalystwan | ||
version: 0.1.1 | ||
version: 0.2.0 | ||
readme: README.md | ||
authors: | ||
- Arkadiusz Cichon <[email protected]> | ||
|
76 changes: 76 additions & 0 deletions
76
playbooks/tests/test_backup_and_restore_running_config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copyright 2024 Cisco Systems, Inc. and its affiliates | ||
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
|
||
--- | ||
|
||
# Helper playbooks to test modules and flows while developing them | ||
|
||
# Tested operations: | ||
|
||
# --- Backup & Restore --- # | ||
|
||
# 1. Backup running-config for all c8000V devices with default backup dir | ||
# 2. Using backup files, create CLI templates for each Edge device | ||
# 3. Attach backup templates to the Edge devices | ||
# 4. Post-test - Set vManage mode for cEdge devices - in order to use previous templates | ||
|
||
|
||
- name: Testing playbook to verify backup & restore operations | ||
hosts: localhost | ||
gather_facts: false | ||
vars_files: | ||
- configuration_file_dev_vars.yml | ||
vars: | ||
manager_authentication: &manager_authentication | ||
url: "{{ (vmanage_instances | first).mgmt_public_ip }}" | ||
username: "{{ (vmanage_instances | first).admin_username }}" | ||
password: "{{ (vmanage_instances | first).admin_password }}" | ||
tasks: | ||
- name: 1. Backup running-config for all c8000V devices with default backup dir (in CWD) | ||
cisco.catalystwan.devices_info: | ||
backup: true | ||
filters: | ||
personality: "vedge" | ||
manager_credentials: | ||
<<: *manager_authentication | ||
register: backup_info | ||
|
||
- name: 2. Using backup files, create CLI templates for each Edge device | ||
cisco.catalystwan.cli_templates: | ||
state: present | ||
template_name: "backup-template-{{ device_item.filename }}" | ||
template_description: "Template for {{ device_item.hostname }} created from backup file." | ||
config_file: "{{ device_item.backup_path }}" | ||
device_model: vedge-C8000V | ||
manager_credentials: | ||
<<: *manager_authentication | ||
loop: "{{ backup_info.backup_paths }}" | ||
loop_control: | ||
loop_var: device_item | ||
when: backup_info.backup_paths | length > 0 | ||
|
||
- name: 3. Attach backup templates to the Edge devices | ||
cisco.catalystwan.device_templates: | ||
state: attached | ||
template_name: "backup-template-{{ device_item.filename }}" | ||
hostname: "{{ device_item.hostname }}" | ||
manager_credentials: | ||
<<: *manager_authentication | ||
loop: "{{ backup_info.backup_paths }}" | ||
loop_control: | ||
loop_var: device_item | ||
when: backup_info.backup_paths | length > 0 | ||
|
||
- name: 4. Post-test - Set vManage mode for cEdge devices - in order to use previous templates | ||
cisco.catalystwan.vmanage_mode: | ||
state: present | ||
hostnames: | ||
- "{{ device_item.hostname }}" | ||
manager_credentials: | ||
<<: *manager_authentication | ||
loop: "{{ backup_info.backup_paths }}" | ||
loop_control: | ||
loop_var: device_item | ||
when: backup_info.backup_paths | length > 0 | ||
|
||
# Add task to remove all unused templates (not attached) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright 2024 Cisco Systems, Inc. and its affiliates | ||
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
|
||
--- | ||
|
||
# Helper playbooks to test modules and flows while developing them | ||
|
||
# --- Device Templates --- # | ||
|
||
|
||
- name: Testing playbook to verify cisco.catalystwan.device_templates module operations | ||
hosts: localhost | ||
gather_facts: false | ||
vars_files: | ||
- configuration_file_dev_vars.yml | ||
vars: | ||
manager_authentication: &manager_authentication | ||
url: "{{ (vmanage_instances | first).mgmt_public_ip }}" | ||
username: "{{ (vmanage_instances | first).admin_username }}" | ||
password: "{{ (vmanage_instances | first).admin_password }}" | ||
tasks: | ||
- name: 1. Get all Non-Default Device Templates available | ||
cisco.catalystwan.device_templates_info: | ||
filters: | ||
factory_default: false | ||
manager_credentials: | ||
<<: *manager_authentication | ||
register: device_templates | ||
|
||
- name: 2. Delete selected Device Template from vManage | ||
cisco.catalystwan.device_templates: | ||
state: absent | ||
template_name: "vc8000-device-template" | ||
manager_credentials: | ||
<<: *manager_authentication | ||
|
||
- name: 3. Create example Device Template with default templates | ||
cisco.catalystwan.device_templates: | ||
state: present | ||
template_name: "vc8000-device-template" | ||
template_description: "vc8000-device-template" | ||
device_type: vedge-C8000V | ||
device_role: sdwan-edge | ||
general_templates: | ||
- name: "Factory_Default_Cisco_BFD_Template" | ||
subtemplates: "Factory_Default_Cisco_Logging_Template" | ||
- name: "Factory_Default_Cisco_OMP_ipv46_Template" | ||
- name: "Factory_Default_Cisco_Security_Template" | ||
manager_credentials: | ||
<<: *manager_authentication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2024 Cisco Systems, Inc. and its affiliates | ||
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
|
||
--- | ||
|
||
# Helper playbooks to test modules and flows while developing them | ||
|
||
# --- Device Templates Info --- # | ||
|
||
|
||
- name: Testing playbook to verify cisco.catalystwan.device_templates_info module operations | ||
hosts: localhost | ||
gather_facts: false | ||
vars_files: | ||
- configuration_file_dev_vars.yml | ||
vars: | ||
manager_authentication: &manager_authentication | ||
url: "{{ (vmanage_instances | first).mgmt_public_ip }}" | ||
username: "{{ (vmanage_instances | first).admin_username }}" | ||
password: "{{ (vmanage_instances | first).admin_password }}" | ||
tasks: | ||
- name: 1. Get all Non-Default Device Templates available | ||
cisco.catalystwan.device_templates_info: | ||
filters: | ||
factory_default: false | ||
manager_credentials: | ||
<<: *manager_authentication | ||
register: device_templates | ||
|
||
- name: 2. Debug Templates Info | ||
ansible.builtin.debug: | ||
msg: "{{ device_templates }}" | ||
|
||
- name: 3. Backup all Non-Default Device Templates available | ||
cisco.catalystwan.device_templates_info: | ||
filters: | ||
factory_default: false | ||
backup: true | ||
manager_credentials: | ||
<<: *manager_authentication | ||
register: device_templates |
Oops, something went wrong.