junos_rpc:
host={{ansible_host}}
user={{USERNAME}}
passwd={{DEVICE_PASSWORD}}
rpc=get-config
filter_xml="<configuration><system><syslog/></system></configuration>"
dest=/tmp/{{inventory_hostname}}.conf
To view this discussion on the web visit https://groups.google.com/d/msgid/junos-python-ez/D3033BA2.28F19%25nitinkr%40juniper.net.
2016-03-05 20:39:46,747:CONFIG:204.93.204.238:connecting to host: r...@192.168.1.1:830
2016-03-05 20:39:46,811:ncclient.transport.ssh:Connected (version 2.0, client OpenSSH_6.0)2016-03-05 20:39:47,259:ncclient.transport.ssh:Authentication (password) successful!2016-03-05 20:39:49,256:ncclient.transport.session:initialized: session-id=473 | server_capabilities=['http://xml.juniper.net/dmi/system/1.0', 'urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0', 'http://xml.juniper.net/netconf/junos/1.0', 'urn:ietf:params:xml:ns:netconf:capability:validate:1.0', 'urn:ietf:params:xml:ns:netconf:capability:candidate:1.0', 'urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file', 'urn:ietf:params:xml:ns:netconf:base:1.0']2016-03-05 20:39:49,256:CONFIG:192.168.1.1:Getting config with filter=<configuration><system/><syslog/></configuration>2016-03-05 20:39:49,256:CONFIG:192.168.1.1:Getting config with options={'format': 'text'}2016-03-05 20:39:49,257:ncclient.operations.rpc:Requesting 'ExecuteRpc'2016-03-05 20:39:49,372:CONFIG:192.168.1.1:Unable to get config: RpcError(severity: error, bad_element: syslog, message: syntax error, expecting </configuration>)2016-03-05 20:39:49,373:ncclient.operations.rpc:Requesting 'CloseSession'
I believe I'm specifying the path correctly per the example at http://junos-ansible-modules.readthedocs.org/en/1.2.0/junos_get_config.html which shows an example of "groups/routeinst/routing-instances/ISP-1"
Any insight would be greatly appreciated!
-Dan
--
You received this message because you are subscribed to the Google Groups "Junos Python EZ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to junos-python-...@googlegroups.com.
Visit this group at https://groups.google.com/group/junos-python-ez.
To view this discussion on the web visit https://groups.google.com/d/msgid/junos-python-ez/f9ee2afb-51a0-4c00-90f8-5baf3e0e03ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/junos-python-ez/ef67c545-eb52-4dab-87ec-b0c82feb0a2d%40googlegroups.com.
---
- name: Junos OS version
hosts: all
roles:
- Juniper.junos
connection: local
gather_facts: no
tasks:
- name: Get rpc run
junos_rpc:
host={{ inventory_hostname }}
rpc=get-config
filter_xml="<configuration><interfaces><interface><name>ge-1/1/4</name></interface></interfaces></configuration>"
dest=/tmp/{{inventory_hostname}}.conf
To view this discussion on the web visit https://groups.google.com/d/msgid/junos-python-ez/E8145E19-6688-4B11-A861-6D8B1AA42832%40acm.org.