Join AnsibleFest at Red Hat Summit!

cisco.mso.ndo_physical_interface module – Manage Physical Interfaces on Cisco Nexus Dashboard Orchestrator (NDO).

Note

This module is part of the cisco.mso collection (version 2.10.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_physical_interface.

Synopsis

  • Manage Physical Interfaces on Cisco Nexus Dashboard Orchestrator (NDO).

  • This module is only supported on ND v3.2 (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

breakout_mode

string

Breakout mode enables breaking down an ethernet port into multiple low-speed ports.

This parameter is available only when physical_interface_type is breakout.

The default value is 4x10G.

Choices:

  • "4x10G"

  • "4x25G"

  • "4x100G"

description

string

The description of the Physical Interface.

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.

interface_descriptions

list / elements=dictionary

The interface settings defined in the interface settings policy will be applied to the interfaces on the node IDs configured in nodes.

This parameter when set to an empty list during an update will clear all the existing interface descriptions.

The API will trigger an error when there are duplicate interface IDs in the list.

description

string

The description of the interface.

interface_id

string

The interface ID.

interfaces

list / elements=string

The interface names where the policy will be deployed.

The old interfaces will be replaced with the new interfaces during an update.

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

aliases: physical_interface

string

The name of the Physical Interface.

nodes

list / elements=string

The node IDs where the Physical Interface policy will be deployed.

Each element can either be a single node ID or a range of IDs.

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.

physical_interface_type

string

The type of the interface policy group.

Choices:

  • "physical"

  • "breakout"

physical_policy

aliases: policy, interface_policy, interface_policy_group, interface_setting

dictionary

The interface group policy required for physical Interface Setting Policy.

This parameter is required when physical_interface_type is physical.

This parameter can be used instead of physical_policy_uuid.

name

string

The name of the Interface Setting Policy.

template

string

The name of the template in which is referred the Interface Setting Policy.

physical_policy_uuid

aliases: policy_uuid, interface_policy_uuid, interface_policy_group_uuid, interface_setting_uuid

string

The UUID of the Interface Setting Policy.

This is only required when creating a new Interface Setting Policy.

This parameter is required when physical_interface_type is physical.

This parameter can be used instead of physical_policy.

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 / required

The name of the template.

The template must be a fabric resource policy template.

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: physical_interface_uuid

string

The UUID of the Physical Interface.

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

Examples

- name: Create a Physical Interface with physical_interface_type set to physical
  cisco.mso.ndo_physical_interface:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_template
    name: ansible_test_physical_interface_physical
    description: "Physical Interface for Ansible Test"
    nodes: [101, 102, 103-105]
    interfaces: "1/1"
    physical_interface_type: physical
    physical_policy: ansible_test_interface_setting_policy_uuid
    state: present
  register: create_physical_interface_type_physical

- name: Create a Physical Interface with physical_interface_type set to breakout
  cisco.mso.ndo_physical_interface:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_template
    name: ansible_test_physical_interface_breakout
    description: "breakout interface for Ansible Test"
    nodes: [101, 102, 103-105]
    interfaces: "1/1"
    physical_interface_type: breakout
    breakout_mode: 4x25G
    interface_descriptions:
      - interface_id: "1/1"
        description: "Interface description for 1/1"
    state: present
  register: create_physical_interface_type_breakout

- name: Query all physical interfaces
  cisco.mso.ndo_physical_interface:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_template
    state: query
  register: query_all

- name: Query a specific Physical Interface with name
  cisco.mso.ndo_physical_interface:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_template
    name: ansible_test_physical_interface_physical
    state: query
  register: query_one_name

- name: Query a specific Physical Interface with UUID
  cisco.mso.ndo_physical_interface:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_template
    uuid: "{{ create_physical_interface_type_breakout.current.uuid }}"
    state: query
  register: query_one_uuid

- name: Delete a Physical Interface with name
  cisco.mso.ndo_physical_interface:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_template
    name: ansible_test_physical_interface_physical
    state: absent

- name: Delete a Physical Interface with UUID
  cisco.mso.ndo_physical_interface:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test_template
    uuid: "{{ query_one_uuid.current.uuid }}"
    state: absent

Authors

  • Anvitha Jain (@anvjain)