Skip to content

Ansible Module: nokia.nsp.ibn

Execute create, update, and delete operations on Nokia NSP's Intent Manager application.

Notes

Requires ansible.netcommon.httpapi connection using Network OS nokia.nsp.nsp.

Synopsis

  • Create, update and delete intent-types in the intent-type catalog.
  • Add, update and delete intent instances.

Parameters

Parameter Type Comments
operation str The operation to perform on NSP's Intent Manager application
Choices: upload_intent_type, add_intent, delete_intent, delete_intent_type
Required: always
path path Path to the filesystem folder containing the intent-type to be uploaded.
Required if operation=upload_intent_type.
intent_type str Name of the intent-type.
Required if operation is add_intent, delete_intent, or delete_intent_type.
version int Version of the intent-type.
Required if operation is add_intent or delete_intent_type.
target str Intent target acting as unique identifier in the realm of the intent-type.
Might be a composition of target compontents.
For required syntax, check intent-type meta-info.json.
config dict Intent configuration (instance of the intent-type YANG model).
Required if operation=add_intent.
desired_state str Desired network state for the intent.
Used if operation=add_intent.
Choices: active, suspend, delete
Default: active
perform str Allows to run an intent operation immediately after intent is created or updated.
If omitted, the intent is only created/updated and no operation is triggered.
Used if operation=add_intent.
Choices: audit, synchronize
remove_from_network bool By default, intents are deleted from the controller (NSP) only keeping the network configuration as is.
To remove the intent from the controller and the network, this option must be set to true.
Used if operation=delete_intent.
Default: false
force bool By default, only the intent-type is removed from the controller (NSP).
If intents for the corresponding intent-type version are present, deletion will fail.
To force deletion of the intent-type together with all intents, this option must be set to true.
Used if operation=delete_intent_type.
Default: false

Examples

- name: Upload intent-type
  nokia.nsp.ibn:
    operation: upload_intent_type
    path: /path/to/intent_types/iplink
  register: upload_result

- name: Add or update intent (then synchronize)
  nokia.nsp.ibn:
    operation: add_intent
    intent_type: "{{ upload_result.intent_type }}"
    version: "{{ upload_result.version }}"
    target: cid001
    config:
      "iplink:iplink":
        description: "Madrid / Barcelona"
        admin-state: enable
        endpoint-a:
          ne-id: "1034::cafe:1"
          port-id: "1/1/c1/1"
        endpoint-b:
          ne-id: "1034::cafe:2"
          port-id: "1/1/c1/1"
    desired_state: active
    perform: synchronize
  register: add_intent_result

- name: Delete intent (remove from network then controller)
  nokia.nsp.ibn:
    operation: delete_intent
    target: cid001
    intent_type: iplink
    remove_from_network: true

- name: Delete intent-type
  nokia.nsp.ibn:
    operation: delete_intent_type
    intent_type: iplink
    version: 1
    force: true

Return Values

Parameter Type Comments
intent_type str Intent-type name
Returned: upload_intent_type, add_intent, delete_intent, delete_intent_type
version int Intent-type version
Returned: upload_intent_type, add_intent, delete_intent_type
target str Intent target
Returned: add_intent, delete_intent
changed bool True when something was created, updated, or deleted
Returned: always
msg str Human-readable result message
Returned: always
audit_result dict Output of audit when perform=audit
Returned: add_intent with perform=audit
sync_result dict Output of synchronize when perform=synchronize
Returned: operation=add_intent with perform=synchronize

New in version "0.1.0"