ansible-playbook mock.yml
it will generate ./rpc.xml
- modify IP and creds in ./ciena_netconf_lone.yml
ansible-playbook ciena_netconf_lone.yml
Note: the xml contents in ./rpc.xml do not have a root xml parent. This is because the ansible.netcommon.netconf_rpc
module will add the root xml parent automatically. is injected as the root xml parent for the rpc edit-config operation.
tasks:
- name: Netconf execution
ansible.netcommon.netconf_rpc:
rpc: edit-config
xmlns: "urn:ietf:params:xml:ns:netconf:base:1.0"
content: |
<target>
<running />
</target>
<default-operation>merge</default-operation>
<config>
<fps xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-mef-fp">
<fp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="remove">
<name>foo</name>
</fp>
</fps>
</config>
connection: netconf
Run this in a device to monitor the netconf session
log monitor netconf-rpc all