-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path13_netconf_get_config.yml
52 lines (48 loc) · 1.21 KB
/
13_netconf_get_config.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
---
- name: Get Config
hosts: lab_iosxe
tasks:
########## Get COnfig
# - name: Print Running Config
# netconf_get:
# source: running
# display: json
# register: config_out
# - debug:
# var: config_out["output"]
####### Get Hostname
- name: Get Hostname
netconf_get:
source: running
display: json
filter:
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
<hostname></hostname>
</native>
register: config_out
- debug:
var: config_out["output"]
# ###### Get Interface
- name: Get Interfaces
netconf_get:
source: running
display: json
filter:
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
<interface></interface>
</native>
register: config_out
- debug:
var: config_out["output"]
###### Get Username
- name: Get Username
netconf_get:
source: running
display: json
filter:
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
<username></username>
</native>
register: config_out
- debug:
var: config_out["output"]