-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_module_devices_certificates.yml
63 lines (54 loc) · 2.56 KB
/
test_module_devices_certificates.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# 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:
# 1. Change all Edge devices validity to Valid
# 2. Send to controllers to sync the WAN Edge list on all controllers
- name: Testing playbook to verify cisco.catalystwan.devices_certificates module operations
hosts: localhost
gather_facts: false
vars_files:
- configuration_file_dev_vars.yml
tasks:
- name: Get list of Edge devices
cisco.catalystwan.devices_info:
device_category: vedges
manager_authentication:
url: "{{ (vmanage_instances | first).mgmt_public_ip }}"
username: "{{ (vmanage_instances | first).admin_username }}"
password: "{{ (vmanage_instances | first).admin_password }}"
register: edge_devices
- name: 1. Change all Edge devices validity to Valid
cisco.catalystwan.devices_certificates:
change_vedge_list_validity:
chasis_number: "{{ item.chasis_number }}"
validity: "valid"
manager_authentication:
url: "{{ (vmanage_instances | first).mgmt_public_ip }}"
username: "{{ (vmanage_instances | first).admin_username }}"
password: "{{ (vmanage_instances | first).admin_password }}"
loop: "{{ edge_devices.devices }}"
loop_control:
label: "Device chasis number: {{ item.chasis_number }}"
when: edge_devices.devices | length > 0
- name: 2. Send to controllers to sync the WAN Edge list on all controllers
cisco.catalystwan.devices_certificates:
send_to_controllers: true
manager_authentication:
url: "{{ (vmanage_instances | first).mgmt_public_ip }}"
username: "{{ (vmanage_instances | first).admin_username }}"
password: "{{ (vmanage_instances | first).admin_password }}"
# - name: 3. Change Edge devices validity to Invalid before carrying out delete operation
# cisco.catalystwan.devices_certificates:
# change_vedge_list_validity:
# chasis_number: "{{ device_item.chasis_number }}"
# validity: "invalid"
# manager_authentication:
# url: "{{ (vmanage_instances | first).mgmt_public_ip }}"
# username: "{{ (vmanage_instances | first).admin_username }}"
# password: "{{ (vmanage_instances | first).admin_password }}"
# register: devices_result
# loop: "{{ devices_result.devices }}"
# loop_control:
# loop_var: device_item