cisco.mso.ndo_fabric_span_session_source module – Manage Fabric SPAN Sessions Source 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_source.

New in cisco.mso 2.11.0

Synopsis

  • Manage Switched Port Analyzer (SPAN) Sessions Source 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

access_paths

list / elements=dictionary

The Access Path of the SPAN Session source.

Providing a new list of access_paths will completely replace an existing one from the SPAN Session source.

Providing an empty list will remove the access_paths=[] from the SPAN Session source.

access_path_type

aliases: type

string

The type of the Access Path.

Choices:

  • "port"

  • "port_channel"

  • "virtual_port_channel"

  • "vpc_component_pc"

interface

string

The interface of the Node. This parameter is required to configure the access_paths.access_path_type=port.

name

string

The name of the ‘Port Channel’ or ‘Virtual Port Channel’ which is used to create the Access Path.

node

integer

The ID of the Node. This parameter is required when access_paths.access_path_type=port or access_paths.access_path_type=vpc_component_pc.

template

string

template_id

string

uuid

string

The UUID of the ‘Access Port’ or ‘Port Channel’, or ‘Virtual Port Channel’ which is used to create the Access Path.

direction

string

The direction of the SPAN Session source.

Defaults to direction=incoming when unset during creation.

Choices:

  • "incoming"

  • "outgoing"

  • "both"

filter_epg

aliases: epg

dictionary

The Filter EPG of the SPAN Session source.

When the Filter EPG is specified in the configuration, the Filter L3Out will be removed.

This parameter and filter_l3out are mutually exclusive.

Providing an empty dictionary filter_epg={} will remove the filter l3out from the SPAN Session source.

reference

aliases: ref

dictionary

The EPG object detail used to configure the Filter EPG.

This parameter or filter_epg.uuid is required.

anp

string

The name of the ANP that contains the EPG.

This parameter or filter_epg.reference.anp_uuid is required.

anp_uuid

string

The UUID of the ANP that contains the EPG.

This parameter or filter_epg.reference.anp is required.

name

string / required

The name of the EPG.

schema

string

The name of the schema that contains the EPG.

This parameter or filter_epg.reference.schema_id is required.

schema_id

string

The ID of the schema that contains the EPG.

This parameter or filter_epg.reference.schema is required.

template

string

The name of the template that contains the EPG.

This parameter or filter_epg.reference.template_id is required.

template_id

string

The ID of the template that contains the EPG.

This parameter or filter_epg.reference.template is required.

uuid

aliases: epg_uuid

string

The UUID of the EPG used to configure the Filter EPG.

This parameter or filter_epg.reference is required.

filter_l3out

aliases: l3out

dictionary

The Filter L3Out of the SPAN Session source.

When the Filter L3Out is specified in the configuration, the Filter EPG will be removed.

This parameter and filter_epg are mutually exclusive.

The L3Out must be defined in either the L3Out template or directly within the APIC tenant.

The Filter L3Out for a SPAN Session source does not support using an L3Out from an application tenant template.

Providing an empty dictionary filter_l3out={} will remove the filter l3out from the SPAN Session source.

reference

aliases: ref

dictionary

The Filter L3Out object detail used to configure the Filter L3Out.

This parameter or filter_l3out.uuid is required.

name

string / required

The name of the L3Out.

template

string

The name of the L3Out template.

This parameter or filter_l3out.reference.template_id, or filter_l3out.reference.tenant is required.

template_id

string

The ID of the L3Out template.

This parameter or filter_l3out.reference.template, or filter_l3out.reference.tenant is required.

tenant

string

The name of the tenant. This parameter is used to associate the L3Out from APIC.

This parameter or filter_l3out.reference.template, or filter_l3out.reference.template_id is required.

uuid

aliases: l3out_uuid

string

The UUID of the L3Out.

This parameter or filter_l3out.reference is required.

vlan_id

integer

The ID of the VLAN, which is associated with L3Out interface.

This parameter is required to configure the Filter L3Out.

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.

name

string

The name of the SPAN Session source.

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.

span_drop_packets

boolean

The SPAN Drop Packets of the SPAN Session source.

SPAN Drop Packets are packets that get dropped when the SPAN destination port cannot handle the volume of mirrored traffic from the source ports.

Defaults to span_drop_packets=false when unset during creation.

The filter_epg and filter_l3out are not configurable when span_drop_packets=true.

Choices:

  • false

  • true

span_session_name

string

The name of the SPAN Session.

This parameter or span_session_uuid is required.

span_session_uuid

string

The UUID of the SPAN Session.

This parameter or span_session_name is required.

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.

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.ndo_fabric_span_session

Manage Fabric SPAN Sessions 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).

cisco.mso.ndo_virtual_port_channel_interface

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

Examples

- name: Create the SPAN Session source with access paths
  cisco.mso.ndo_fabric_span_session_source:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_mon_pol
    span_session_name: ansible_test_span_session
    name: ansible_test_source_2
    direction: outgoing
    span_drop_packets: true
    access_paths:
      - access_path_type: port
        node: 101
        interface: eth1/6
      - access_path_type: port_channel
        name: ansible_test_pc1
        template: ansible_test_fabric_resource
      - access_path_type: virtual_port_channel
        name: ansible_test_vpc1
        template: ansible_test_fabric_resource
      - access_path_type: vpc_component_pc
        name: ansible_test_vpc1
        template: ansible_test_fabric_resource
        node: 101
    state: present
  register: add_ansible_test_source_2

- name: Create the SPAN Session source with access path and filter EPG
  cisco.mso.ndo_fabric_span_session_source:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_mon_pol
    span_session_name: ansible_test_span_session
    name: ansible_test_source_3
    direction: outgoing
    access_paths:
      - access_path_type: port
        node: 101
        interface: eth1/6
    filter_epg:
      reference:
        schema: ansible_test_schema
        template: template1
        anp: ansible_test_anp
        name: ansible_test_epg1
    state: present

- name: Create the SPAN Session source with access path and filter L3Out
  cisco.mso.ndo_fabric_span_session_source:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_mon_pol
    span_session_name: ansible_test_span_session
    name: ansible_test_source_4
    direction: outgoing
    access_paths:
      - access_path_type: port
        node: 101
        interface: eth1/1
    filter_l3out:
      reference:
        name: ansible_test_l3out
        template: ansible_test_l3out_template
      vlan_id: 41
    state: present

- name: Create the SPAN Session source with access paths UUID
  cisco.mso.ndo_fabric_span_session_source:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template_id: "{{ add_span_session.current.templateId }}"
    span_session_uuid: "{{ add_span_session.current.uuid }}"
    name: ansible_test_source_1
    access_paths:
      - access_path_type: port
        node: 101
        interface: eth1/1
      - access_path_type: port_channel
        uuid: "{{ add_fabric_pc_1.current.uuid }}"
      - access_path_type: virtual_port_channel
        uuid: "{{ add_fabric_vpc1.current.uuid }}"
      - access_path_type: vpc_component_pc
        uuid: "{{ add_fabric_vpc1.current.uuid }}"
        node: 101
    state: present

- name: Update the SPAN Session source Filter EPG using UUID
  cisco.mso.ndo_fabric_span_session_source:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_mon_pol
    span_session_name: ansible_test_span_session
    name: ansible_test_source_1
    direction: outgoing
    filter_epg:
      uuid: "{{ add_epg.current.epg }}"
    state: present

- name: Update the SPAN Session source Filter L3Out using UUID
  cisco.mso.ndo_fabric_span_session_source:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_mon_pol
    span_session_name: ansible_test_span_session
    name: ansible_test_source_1
    direction: outgoing
    access_paths:
      - access_path_type: port_channel
        name: ansible_test_pc1
        template: ansible_test_fabric_resource
    filter_l3out:
      uuid: "{{ add_l3out.current.uuid }}"
      vlan_id: 42
    state: present

- name: Query a specific SPAN Session source
  cisco.mso.ndo_fabric_span_session_source:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_mon_pol
    span_session_name: ansible_test_span_session
    name: ansible_test_source_1
    state: query
  register: query_one

- name: Query all SPAN Session sources
  cisco.mso.ndo_fabric_span_session_source:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_mon_pol
    span_session_name: ansible_test_span_session
    state: query
  register: query_all

- name: Delete the SPAN Session source
  cisco.mso.ndo_fabric_span_session_source:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_mon_pol
    span_session_name: ansible_test_span_session
    name: ansible_test_source_1
    state: absent

Authors

  • Sabari Jaganathan (@sajagana)