cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
166
Views
0
Helpful
0
Replies

nexus 9k and netconf

DennisDammers
Level 1
Level 1

I'm currently looking into the possebilties of netconf and ansible with a nexus 9k switch. 

I would like to push the config to a "candidate" on the nexus and diff it with the running config. The playbook works, but the config is not pushed to candidate. 

On the cisco site i found some documentation. Here is a snippit from it.

 

Using the NETCONF Agent

General Commands

The NETCONF Agent is enabled or disabled by the command [nofeature netconf.

Initializing the Candidate Configuration Datastore

The candidate configuration can only be initialized with the contents of the running configuration. To Initialize the candiate configuring datastore, send a Copy-Config request using SSH, with candidate as the target and running as the source.

Performing Read and Write on the Candidate Configuration

To read from the candidate configuration, send a Get-Config request with SSH, using candidate as the source.

To write to the contents of the candidate configuration, send an Edit-Config request with SSH, using candidate as the target.

 

How do i initialize the candidate? Has anyone has an example? 

 

I have the following playbook:

- name: Push NETCONF Data to Candidate Datastore
  ansible.netcommon.netconf_config:
    backup: true
    target: "candidate"
    commit: false
    get_filter: |
        <name></name>
      </System>
    content: |
      <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
        <System xmlns="http://cisco.com/ns/yang/cisco-nx-os-device">
          <name>LEAF1</name>
        </System>
      </config>
0 Replies 0

Review Cisco Networking for a $25 gift card