netconf_get – Fetch configuration/state data from NETCONF enabled network devices¶
New in version 2.6.
Synopsis¶
- NETCONF is a network management protocol developed and standardized by the IETF. It is documented in RFC 6241.
- This module allows the user to fetch configuration and state data from NETCONF enabled network devices.
Requirements¶
The below requirements are needed on the host that executes this module.
- ncclient (>=v0.5.2)
- jxmlease
Parameters¶
Notes¶
Note
- This module requires the NETCONF system service be enabled on the remote device being managed.
- This module supports the use of connection=netconf
- This module is supported on
ansible_network_os
network platforms. See the Network Platform Options for details.
Examples¶
- name: Get running configuration and state data
netconf_get:
- name: Get configuration and state data from startup datastore
netconf_get:
source: startup
- name: Get system configuration data from running datastore state (junos)
netconf_get:
source: running
filter: <configuration><system></system></configuration>
- name: Get configuration and state data in JSON format
netconf_get:
display: json
- name: get schema list using subtree w/ namespaces
netconf_get:
display: json
filter: <netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><schemas><schema/></schemas></netconf-state>
lock: never
- name: get schema list using xpath
netconf_get:
display: xml
filter: /netconf-state/schemas/schema
- name: get interface configuration with filter (iosxr)
netconf_get:
display: pretty
filter: <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"></interface-configurations>
lock: if-supported
- name: Get system configuration data from running datastore state (junos)
netconf_get:
source: running
filter: <configuration><system></system></configuration>
lock: if-supported
- name: Get complete configuration data from running datastore (SROS)
netconf_get:
source: running
filter: <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"/>
- name: Get complete state data (SROS)
netconf_get:
filter: <state xmlns="urn:nokia.com:sros:ns:yang:sr:state"/>
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Network Team. [network]
Red Hat Support¶
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Authors¶
- Ganesh Nalawade (@ganeshrn)
- Sven Wisotzky (@wisotzky)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.