-
Notifications
You must be signed in to change notification settings - Fork 6
/
validate.yml
32 lines (28 loc) · 899 Bytes
/
validate.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
---
# Need to add to requirements file these:
# ansible-galaxy collection install ansible.utils # version greater than 2.0.1
# ansible-galaxy collection install ansible.netcommon
# ansible-galaxy collection install cisco.ios
# ansible-galaxy collection install community.general
- hosts: "{{ my_devices }}"
connection: ansible.netcommon.network_cli
gather_facts: "{{ my_facts }}"
vars:
ansible_network_os: cisco.ios.ios
tasks:
- name: Parse list of commands
include_tasks: validate_commands.yml
loop:
- show version
- show interfaces
- show lldp neighbors
- show ip bgp summary
- show ip ospf neighbor
loop_control:
loop_var: command
# - name: Print all structured data
# ansible.builtin.debug:
# var: my_dict
- name: Validate state from commands
include_tasks: validate_state.yml
...