community.network.nso_config – Manage Cisco NSO configuration and service synchronization.

Note

This plugin is part of the community.network collection (version 1.3.2).

To install it use: ansible-galaxy collection install community.network.

To use it in a playbook, specify: community.network.nso_config.

Synopsis

  • This module provides support for managing configuration in Cisco NSO and can also ensure services are in sync.

Requirements

The below requirements are needed on the host that executes this module.

  • Cisco NSO version 3.4.12 or higher, 4.2.7 or higher, 4.3.8 or higher, 4.4.3 or higher, 4.5 or higher.

Parameters

Parameter Choices/Defaults Comments
data
string / required
NSO data in format as | display json converted to YAML. List entries can be annotated with a __state entry. Set to in-sync/deep-in-sync for services to verify service is in sync with the network. Set to absent in list entries to ensure they are deleted if they exist in NSO.
password
string / required
NSO password
timeout
integer
Default:
300
JSON-RPC request timeout in seconds
url
string / required
NSO JSON-RPC URL, http://localhost:8080/jsonrpc
username
string / required
NSO username
validate_certs
boolean
    Choices:
  • no ←
  • yes
When set to true, validates the SSL certificate of NSO when using SSL

Examples

- name: Create L3VPN
  community.network.nso_config:
    url: http://localhost:8080/jsonrpc
    username: username
    password: password
    data:
      l3vpn:vpn:
        l3vpn:
        - name: company
          route-distinguisher: 999
          endpoint:
          - id: branch-office1
            ce-device: ce6
            ce-interface: GigabitEthernet0/12
            ip-network: 10.10.1.0/24
            bandwidth: 12000000
            as-number: 65101
          - id: branch-office2
            ce-device: ce1
            ce-interface: GigabitEthernet0/11
            ip-network: 10.7.7.0/24
            bandwidth: 6000000
            as-number: 65102
          - id: branch-office3
            __state: absent
        __state: in-sync

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
changes
complex
always
List of changes

Sample:
[{'from': '6000000', 'path': '/l3vpn:vpn/l3vpn{example}/endpoint{office}/bandwidth', 'to': '12000000', 'type': 'set'}]
 
from
string
When previous value is present on value change
Previous value if any, else null

 
path
string
always
Path to value changed

 
to
string
When new value is present on value change
Current value if any, else null.

 
type
string
success
Type of change. create|delete|set|re-deploy

diffs
complex
always
List of sync changes

Sample:
[{'diff': ' devices {\n device pe3 {\n config {\n alu:service {\n vprn 65101 {\n bgp {\n group example-ce6 {\n- peer-as 65102;\n+ peer-as 65101;\n }\n }\n }\n }\n }\n }\n }\n', 'path': '/l3vpn:vpn/l3vpn{example}'}]
 
diff
string
always
configuration difference triggered the re-deploy

 
path
string
always
keypath to service changed



Authors

  • Claes Nästén (@cnasten)