-
Notifications
You must be signed in to change notification settings - Fork 0
/
show_vlan_brief.yml
38 lines (27 loc) · 939 Bytes
/
show_vlan_brief.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
---
# This is a playbook for Ansible using network-engine with "show vlan brief" parser.
- hosts: unknown
roles:
- ansible-network.network-engine
tasks:
- name: Run 'show vlan brief'
ios_command:
commands:
- show vlan brief
register: output
# - name: Display the output
# debug: var=output.stdout
- name: Parse the output
command_parser:
file: "parsers/ios/show_vlan_brief_parser.yml"
content: "{{ output.stdout[0] }}"
# - name: Display the data
# debug: var=vlan_brief_facts
- name: Delete '/tmp/vlan_brief_facts-[inventory_hostname].json'
file:
path: "/tmp/vlan_brief_facts-{{ inventory_hostname }}.json"
state: absent
- name: Write interfaces_facts to '/tmp/vlan_brief_facts-[inventory_hostname].json'
copy:
content: "{{ vlan_brief_facts | to_nice_json }}"
dest: "/tmp/vlan_brief_facts-{{ inventory_hostname }}.json"