community.general.nso_config (0.1.1) — module

Manage Cisco NSO configuration and service synchronization.

Authors: Claes Nästén (@cnasten)

preview | supported by certified

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

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


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create L3VPN
  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

Inputs

    
url:
    description: NSO JSON-RPC URL, http://localhost:8080/jsonrpc
    required: true
    type: str

data:
    description: '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.

      '
    required: true

timeout:
    default: 300
    description: JSON-RPC request timeout in seconds
    type: int

password:
    description: NSO password
    required: true
    type: str

username:
    description: NSO username
    required: true
    type: str

validate_certs:
    default: false
    description: When set to true, validates the SSL certificate of NSO when using SSL
    required: false
    type: bool

Outputs

changes:
  contains:
    from:
      description: Previous value if any, else null
      returned: When previous value is present on value change
      type: str
    path:
      description: Path to value changed
      returned: always
      type: str
    to:
      description: Current value if any, else null.
      returned: When new value is present on value change
    type:
      description: Type of change. create|delete|set|re-deploy
  description: List of changes
  returned: always
  sample:
  - from: '6000000'
    path: /l3vpn:vpn/l3vpn{example}/endpoint{office}/bandwidth
    to: '12000000'
    type: set
  type: complex
diffs:
  contains:
    diff:
      description: configuration difference triggered the re-deploy
      returned: always
      type: str
    path:
      description: keypath to service changed
      returned: always
      type: str
  description: List of sync changes
  returned: always
  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}
  type: complex