Skip to content

Commit

Permalink
add playbooks for backup & restore device templates with policies
Browse files Browse the repository at this point in the history
  • Loading branch information
cicharka committed Aug 7, 2024
1 parent 9c38d0d commit 67d0d20
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ verbosity: 1
mock_modules:
- cisco.catalystwan.wait_for_api_server
- azure.azcollection.azure_rm_account_info
- cisco.catalystwan.device_templates_recovery
# - zuul_return
# # note the foo.bar is invalid as being neither a module or a collection
# - fake_namespace.fake_collection.fake_module
Expand All @@ -43,6 +44,7 @@ mock_roles:
- cisco.catalystwan.vmanage_mode
- cisco.catalystwan.health_checks


# - mocked_role
# - author.role_name # old standalone galaxy role
# - fake_namespace.fake_collection.fake_role # role within a collection
Expand Down
22 changes: 22 additions & 0 deletions playbooks/backup_restore/backup_device_configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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)

# NOTE: This is example playbook that requires following variables:
# manager_authentication: url, username, password
# backup_dir_path

- name: Example playbook with task to backup Device Templates with Policies and Feature Templates
hosts: localhost
gather_facts: false
vars:
manager_authentication: &manager_authentication
url: # your manager url
username: # your manager username
password: # your manager password
tasks:
- name: Perform backup of all non factory default Device Templates (no filters == backup non factory default)
cisco.catalystwan.device_templates_recovery:
mode: backup
# backup_dir_path: # path to create backup directory that will store exported configuration
manager_credentials:
<<: *manager_authentication
22 changes: 22 additions & 0 deletions playbooks/backup_restore/restore_device_configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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)

# NOTE: This is example playbook that requires following variables:
# manager_authentication: url, username, password
# backup_dir_path

- name: Example playbook with task to restore Device Templates with Policies and Feature Templates
hosts: localhost
gather_facts: false
vars:
manager_authentication: &manager_authentication
url: # your manager url
username: # your manager username
password: # your manager password
tasks:
- name: Restore configuration from provided backup directory
cisco.catalystwan.device_templates_recovery:
mode: restore
# backup_dir_path: # path to backup directory from which templates will be imported
manager_credentials:
<<: *manager_authentication
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ azure-storage-blob==12.11.0
bcrypt==4.1.2
boto3==1.34.78
botocore==1.34.78
catalystwan==0.33.4
catalystwan==0.34.0.dev1
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
Expand Down

0 comments on commit 67d0d20

Please sign in to comment.