cisco.mso.ndo_fabric_span_session module – Manage Fabric SPAN Sessions on Cisco Nexus Dashboard Orchestrator (NDO).

Note

This module is part of the cisco.mso collection (version 2.11.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cisco.mso. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cisco.mso.ndo_fabric_span_session.

New in cisco.mso 2.11.0

Synopsis

  • Manage Switched Port Analyzer (SPAN) Sessions on Cisco Nexus Dashboard Orchestrator (NDO).

  • This module is only supported on ND v3.1 (NDO v4.4) and later.

Requirements

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

  • Multi Site Orchestrator v2.1 or newer

Parameters

Parameter

Comments

admin_state

string

The administrative state of the SPAN Session.

Defaults to enabled when unset during creation.

Choices:

  • "enabled"

  • "disabled"

description

string

The description of the SPAN Session.

destination_epg

dictionary

The destination EPG configuration group.

This parameter or destination_port or destination_port_channel is required when creating the SPAN Session.

destination_ip

string

The destination IP address to route SPAN Session packets.

dscp

string

The DSCP value for sending the monitored SPAN Session packets.

Defaults to unspecified when unset during creation.

Choices:

  • "af11"

  • "af12"

  • "af13"

  • "af21"

  • "af22"

  • "af23"

  • "af31"

  • "af32"

  • "af33"

  • "af41"

  • "af42"

  • "af43"

  • "cs0"

  • "cs1"

  • "cs2"

  • "cs3"

  • "cs4"

  • "cs5"

  • "cs6"

  • "cs7"

  • "expedited_forwarding"

  • "voice_admit"

  • "unspecified"

enforce_span_version

boolean

Enforce the SPAN Session version defined in destination_epg.span_version.

Defaults to true when unset during creation.

Choices:

  • false

  • true

epg

dictionary

The destination EPG to use for the SPAN Session.

This parameter or destination_epg.epg_uuid is required.

anp

string

The name of the ANP that contains the destination EPG.

This parameter or destination_epg.epg.anp_uuid is required.

anp_uuid

string

The UUID of the ANP that contains the destination EPG.

This parameter or destination_epg.epg.anp is required.

name

string / required

The name of the destination EPG.

schema

string

The name of the schema that contains the destination EPG.

This parameter or destination_epg.epg.schema_id is required.

schema_id

string

The ID of the schema that contains the destination EPG.

This parameter or destination_epg.epg.schema is required.

template

string

The name of the template that contains the destination EPG.

This parameter or destination_epg.epg.template_id is required.

template_id

string

The ID of the template that contains the destination EPG.

This parameter or destination_epg.epg.template is required.

epg_uuid

string

The UUID of the destination EPG to use for the SPAN Session.

This parameter or destination_epg.epg is required.

flow_id

integer

The flow ID of the SPAN Session packets.

The value must be in the range 1 - 1023.

Defaults to 1 when unset during creation.

source_ip_prefix

string

The prefix used to assign source IP addresses to ERSPAN packets which can be used to identify which Leaf or Spine is sending the traffic.

This can be any IP. If the prefix is used, the node ID of the source node is used for the undefined bits of the prefix.

span_version

string

The version of the SPAN Session.

Defaults to v2 when unset during creation.

Choices:

  • "v1"

  • "v2"

ttl

integer

The time to live (TTL) of the SPAN Session packets.

The value must be in the range 1 - 1023.

Defaults to 1 when unset during creation.

destination_port

dictionary

The destination port configuration group.

This parameter or destination_epg or destination_port_channel is required when creating the SPAN Session.

port

dictionary

The destination port to use for the SPAN Session.

This parameter or destination_port.port_uuid is required.

interface

string / required

The Ethernet interface of the Node to use for the SPAN Session

node

integer / required

The Node ID of the Node to use for the SPAN Session.

port_uuid

string

The UUID of the destination port to use for the SPAN Session.

This parameter or destination_port.port is required.

destination_port_channel

dictionary

The destination port channel configuration group.

This parameter or destination_epg or destination_port is required when creating the SPAN Session.

port_channel

dictionary

The destination port channel to use for the SPAN Session.

This parameter or destination_port_channel.port_channel_uuid is required.

name

string / required

The name of the destination port channel.

template

string

The name of the template that contains the destination port channel.

This parameter or destination_port_channel.port_channel.template_id is required.

template_id

string

The ID of the template that contains the destination port channel.

This parameter or destination_port_channel.port_channel.template is required.

port_channel_uuid

string

The UUID of the destination port channel to use for the SPAN Session.

This parameter or destination_port_channel.port_channel is required.

host

aliases: hostname

string

IP Address or hostname of the ACI Multi Site Orchestrator host.

If the value is not specified in the task, the value of environment variable MSO_HOST will be used instead.

login_domain

string

The login domain name to use for authentication.

The default value is Local.

If the value is not specified in the task, the value of environment variable MSO_LOGIN_DOMAIN will be used instead.

When using a HTTPAPI connection plugin the inventory variable ansible_httpapi_login_domain will be used if this attribute is not specified.

mtu

integer

The MTU truncation size for the SPAN packets.

The value must be in the range 64 - 9216.

Defaults to 1518 when unset during creation.

name

aliases: span_session

string

The name of the SPAN Session.

output_level

string

Influence the output of this MSO module.

normal means the standard output, incl. current dict

info adds informational output, incl. previous, proposed and sent dicts

debug adds debugging output, incl. filter_string, method, response, status and url information

If the value is not specified in the task, the value of environment variable MSO_OUTPUT_LEVEL will be used instead.

Choices:

  • "debug"

  • "info"

  • "normal" ← (default)

password

string

The password to use for authentication.

If the value is not specified in the task, the value of environment variables MSO_PASSWORD or ANSIBLE_NET_PASSWORD will be used instead.

port

integer

Port number to be used for the REST connection.

The default value depends on parameter `use_ssl`.

If the value is not specified in the task, the value of environment variable MSO_PORT will be used instead.

state

string

Use absent for removing.

Use query for listing an object or multiple objects.

Use present for creating or updating.

Choices:

  • "absent"

  • "query" ← (default)

  • "present"

template

string

The name of the template.

The template must be a Fabric Monitoring Access Policy template.

This parameter or template_id is required.

template_id

string

The ID of the template.

The template must be a Fabric Monitoring Access Policy template.

This parameter or template is required.

timeout

integer

The socket level timeout in seconds.

The default value is 30 seconds.

If the value is not specified in the task, the value of environment variable MSO_TIMEOUT will be used instead.

use_proxy

boolean

If false, it will not use a proxy, even if one is defined in an environment variable on the target hosts.

If the value is not specified in the task, the value of environment variable MSO_USE_PROXY will be used instead.

The default is true.

Choices:

  • false

  • true

use_ssl

boolean

If false, an HTTP connection will be used instead of the default HTTPS connection.

If the value is not specified in the task, the value of environment variable MSO_USE_SSL will be used instead.

When using a HTTPAPI connection plugin the inventory variable ansible_httpapi_use_ssl will be used if this attribute is not specified.

The default is false when using a HTTPAPI connection plugin (mso or nd) and true when using the legacy connection method (only for mso).

Choices:

  • false

  • true

username

string

The username to use for authentication.

If the value is not specified in the task, the value of environment variables MSO_USERNAME or ANSIBLE_NET_USERNAME will be used instead.

uuid

aliases: span_session_uuid

string

The UUID of the SPAN Session.

This parameter is required when the name needs to be updated.

validate_certs

boolean

If false, SSL certificates will not be validated.

This should only set to false when used on personally controlled sites using self-signed certificates.

If the value is not specified in the task, the value of environment variable MSO_VALIDATE_CERTS will be used instead.

The default is true.

Choices:

  • false

  • true

Notes

Note

See Also

See also

cisco.mso.ndo_template

Manage Templates on Cisco Nexus Dashboard Orchestrator (NDO).

cisco.mso.mso_schema_template_anp_epg

Manage Endpoint Groups (EPGs) in schema templates.

cisco.mso.ndo_port_channel_interface

Manage Port Channel Interfaces on Cisco Nexus Dashboard Orchestrator (NDO).

Examples

- name: Create Fabric SPAN Session with destination EPG
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    name: ansible_test_epg
    destination_epg:
      epg:
        schema: ansible_test
        template: Template1
        anp: Anp1
        name: EPG1
      destination_ip: "1.1.1.1"
      source_ip_prefix: "2.2.2.2"
    state: present
  register: create_epg_span_session

- name: Create Fabric SPAN Session with destination Port
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    name: ansible_test_port
    destination_port:
      port:
        node: 101
        interface: "eth1/1"
    state: present

- name: Create Fabric SPAN Session with destination Port Channel
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    name: ansible_test_pc
    destination_port_channel:
      port_channel:
        template: ansible_test
        name: ansible_test_resource_pc_1
    state: present

- name: Update Fabric SPAN Session from destination EPG to destination Port
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    name: ansible_test_epg
    destination_port:
      port:
        node: 101
        interface: "eth1/1"
    state: present

- name: Update Fabric SPAN Session from destination Port to destination Port Channel
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    name: ansible_test_port
    destination_port_channel:
      port_channel:
        template: ansible_test
        name: ansible_test_resource_pc_1
    state: present

- name: Update Fabric SPAN Session from destination Port Channel to destination EPG
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    name: ansible_test_pc
    destination_epg:
      epg:
        schema: ansible_test
        template: Template1
        anp: Anp1
        name: EPG1
      destination_ip: "1.1.1.1"
      source_ip_prefix: "2.2.2.2"
    state: present

- name: Update the Fabric SPAN Session name using UUID
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    uuid: "{{ create_epg_span_session.current.uuid }}"
    name: ansible_test_pc_updated
    state: present

- name: Query a specific Fabric SPAN Session using name
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    name: ansible_test_pc_updated
    state: query
  register: query_with_name

- name: Query a specific Fabric SPAN Session using UUID
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    uuid: "{{ create_epg_span_session.current.uuid }}"
    state: query
  register: query_with_uuid

- name: Query all Fabric SPAN Sessions
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    state: query
  register: query_all_objects

- name: Delete a specific Fabric SPAN Session using Name
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    name: ansible_test_pc_updated
    state: absent

- name: Delete a Fabric SPAN Session using UUID
  cisco.mso.ndo_fabric_span_session:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template_id: ansible_test
    uuid: "{{ create_epg_span_session.current.uuid }}"
    state: absent

Authors

  • Sabari Jaganathan (@sajagana)