Hello,
I am having some trouble using the junos_command
with the rpcs option. I am trying to get the configuration from my router in xml format while using the ‘display inheritance’ option (to resolve groups and interface ranges), but it looks like none of my attributes are being sent:
My task:
- name: get junos config via rpc
junos_command:
rpcs:
- "get-configuration inherit='inherit'"
display: xml
register: output
When I look at the netconf-ops.log on the router, I don’t see the ‘inherit’ parameter:
Sep 30 01:00:48 [16249] Incoming: <?xml version="1.0" encoding="UTF-8"?><nc:rpc xmlns:nc=“urn:ietf:params:xml:ns:netconf:base:1.0” message-id=“urn:uuid:4bf2921b-d4dd-4a03-a20d-4d6144778475”><nc:get-configuration format=“xml”/></nc:rpc>]]>]]>
Also, even though I specify ‘display: xml’, the output I capture in the register is JSON formatted. This is not the case if I don’t use rpcs and instead use ‘command’, in which case i get xml by default.
Am I not specifying additional attributes correctly? I did not understand how to do it (no documentation examples) but looking through the junos_command.py source looks like this is the way it should work.
For now, I’ve had to use netconf_rpc module to get what I want:
- name: get netconf rpc config
netconf_rpc:
rpc: "get-configuration inherit='inherit'"
register: output
Appreciate the help in advance!