cisco.intersight.intersight_port_policy module – Manage Port Policies for Cisco Intersight

Note

This module is part of the cisco.intersight collection (version 2.6.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.intersight.

To use it in a playbook, specify: cisco.intersight.intersight_port_policy.

Synopsis

  • Create, update, and delete Port Policies on Cisco Intersight.

  • Manage port configurations including breakout ports, server roles, uplink port channels, and LAN pin groups.

  • Supports various device models with model-specific port configurations.

  • Port policies define the configuration of unified ports on fabric interconnects.

  • For more information see Cisco Intersight.

Parameters

Parameter

Comments

api_key_id

string / required

Public API Key ID associated with the private key.

If not set, the value of the INTERSIGHT_API_KEY_ID environment variable is used.

api_private_key

path / required

Filename (absolute path) or string of PEM formatted private key data to be used for Intersight API authentication.

If a string is used, Ansible vault should be used to encrypt string data.

Ex. ansible-vault encrypt_string --vault-id tme@/Users/dsoper/Documents/vault_password_file ‘-----BEGIN EC PRIVATE KEY-----

<your private key data>

-----END EC PRIVATE KEY-----’

If not set, the value of the INTERSIGHT_API_PRIVATE_KEY environment variable is used.

api_uri

string

URI used to access the Intersight API.

If not set, the value of the INTERSIGHT_API_URI environment variable is used.

Default: "https://intersight.com/api/v1"

appliance_port_channels

list / elements=dictionary

List of appliance port channel configurations.

Port channels for direct-attached storage connectivity.

admin_speed

string

Administrative speed of the port channel.

Choices:

  • "Auto" ← (default)

  • "1Gbps"

  • "10Gbps"

  • "25Gbps"

  • "40Gbps"

  • "100Gbps"

eth_network_control_policy_name

string / required

Ethernet Network Control Policy name (required).

The relationship to the Fabric Network Control Policy.

eth_network_group_policy_name

string / required

Ethernet Network Group Policy name (required).

The relationship to the Fabric Network Group Policy.

fec

string

Forward Error Correction (FEC) mode.

Choices:

  • "Auto" ← (default)

  • "Off"

string

Link Aggregation Policy name to associate.

The relationship to the Link Aggregation Policy.

mode

string

Port mode for the appliance port channel.

Choices:

  • "trunk" ← (default)

  • "access"

pc_id

integer / required

Port Channel Identifier.

Valid range is 1-256.

ports

list / elements=dictionary / required

List of Ethernet ports to include in the port channel.

port_id

string / required

Port ID to include in the port channel.

Can be a regular port (e.g., 36) or aggregate port (e.g., ‘49/2’).

Aggregate ports use breakout port syntax where ‘49/2’ means sub-port 2 of port 49.

priority

string

QoS priority for the appliance port channel.

Choices:

  • "Best Effort" ← (default)

  • "FC"

  • "Platinum"

  • "Gold"

  • "Silver"

  • "Bronze"

state

string

Whether to create/update or delete the port channel.

Choices:

  • "present" ← (default)

  • "absent"

user_label

string

User-defined label for the port channel.

User label must be between 0 and 128 alphanumeric characters.

appliance_ports

list / elements=dictionary

List of Appliance port configurations.

Appliance ports are used for direct-attached storage connectivity.

admin_speed

string

Administrative speed of the port.

1Gbps only allowed for ports 45-48.

40Gbps and 100Gbps only allowed for ports 49-54.

Choices:

  • "Auto" ← (default)

  • "1Gbps"

  • "10Gbps"

  • "25Gbps"

  • "40Gbps"

  • "100Gbps"

eth_network_control_policy_name

string / required

Ethernet Network Control Policy name (required).

The relationship to the Fabric Network Control Policy.

eth_network_group_policy_name

string / required

Ethernet Network Group Policy name (required).

The relationship to the Fabric Network Group Policy.

fec

string

Forward Error Correction (FEC) mode.

Choices:

  • "Auto" ← (default)

  • "Off"

mode

string

Port mode for the appliance port.

Choices:

  • "trunk" ← (default)

  • "access"

port_id

string / required

Port ID to configure as Appliance port.

Can be a regular port (e.g., 13) or aggregate port (e.g., ‘49/1’).

priority

string

QoS priority for the appliance port.

Choices:

  • "Best Effort" ← (default)

  • "FC"

  • "Platinum"

  • "Gold"

  • "Silver"

  • "Bronze"

state

string

Whether to create/update or delete the appliance port.

Choices:

  • "present" ← (default)

  • "absent"

user_label

string

User-defined label for the port.

User label must be between 0 and 128 alphanumeric characters.

breakout_ports

list / elements=dictionary

List of breakout port configurations.

Breakout ports allow splitting a high-speed port into multiple lower-speed ports.

Device-specific breakout support applies (see device_model documentation).

UCS-FI-6664 does not support breakout ports at all.

custom_mode

string / required

Breakout mode for the ports.

Ethernet breakout modes (BreakoutEthernet10G, BreakoutEthernet25G) are supported on all models that support breakout.

FC breakout modes (BreakoutFibreChannel8G, BreakoutFibreChannel16G, BreakoutFibreChannel32G) are only supported on UCS-FI-6536 and UCSX-S9108-100G.

Choices:

  • "BreakoutEthernet10G"

  • "BreakoutEthernet25G"

  • "BreakoutFibreChannel8G"

  • "BreakoutFibreChannel16G"

  • "BreakoutFibreChannel32G"

port_id

integer / required

Port ID to configure for breakout.

This port will be split into multiple sub-ports (e.g., ‘49/1’, ‘49/2’, ‘49/3’, ‘49/4’).

Must be within the device’s supported breakout port range.

UCS-FI-6454: ports 49-54 (Ethernet breakout only)

UCS-FI-64108: ports 97-108 (Ethernet breakout only)

UCS-FI-6536: ports 1-32 (Ethernet breakout only), ports 33-36 (FC breakout only)

UCSX-S9108-100G: ports 1-2 (FC breakout only), ports 3-6 (Ethernet breakout)

UCS-FI-6536: ports 1-36 (including FC ports)

UCSX-S9108-100G: ports 1-8

state

string

Whether to create/update or delete the breakout port configuration.

Choices:

  • "present" ← (default)

  • "absent"

description

aliases: descr

string

The user-defined description for the Port Policy.

Description can contain letters(a-z, A-Z), numbers(0-9), hyphen(-), period(.), colon(:), or an underscore(_).

device_model

string

The device model for which the Port Policy is intended.

Different models support different port configurations and capabilities.

Required when state=present.

UCS-FI-6454: 54 ports (1-54), FC ports 1-16, breakout ports 49-54

UCS-FI-64108: 108 ports (1-108), FC ports 1-16, breakout ports 97-108, 1Gbps only on ports 89-96, 40/100Gbps only on ports 97-108

UCS-FI-6536: 36 ports (1-36), FC only via breakout ports 33-36, all ports support breakout, 1Gbps only on ports 9-10

UCS-FI-6664: 64 ports (1-64), FC ports 25-40, no breakout support, 40/100Gbps only on ports 1-24 and 41-64

UCSX-S9108-100G: 8 ports (1-8), FC only via breakout ports 1-2, 1Gbps only on ports 7-8

Choices:

  • "UCS-FI-6454"

  • "UCS-FI-64108"

  • "UCS-FI-6536"

  • "UCS-FI-6664"

  • "UCSX-S9108-100G"

list / elements=dictionary

List of Ethernet uplink port channel configurations.

Port channels aggregate multiple Ethernet ports into a single logical link.

string

Administrative speed of the port channel.

Choices:

  • "Auto" ← (default)

  • "1Gbps"

  • "10Gbps"

  • "25Gbps"

  • "40Gbps"

  • "100Gbps"

list / elements=string

List of Ethernet Network Group Policy names to associate.

The Ethernet Network Group Policy specifies a set of VLANs to allow on the uplink port.

The specified VLAN set must be either identical or disjoint from those specified on other uplink interfaces.

Ensure that the VLANs are defined in the VLAN Policy and ‘Auto Allow on Uplinks’ option is disabled.

Note, default VLAN-1 is auto allowed and can be specified as the native VLAN.

string

Forward Error Correction (FEC) mode.

Choices:

  • "Auto" ← (default)

  • "Off"

string

Flow Control Policy name to associate.

string

Link Aggregation Policy name to associate.

string

Link Control Policy name to associate.

integer / required

Port Channel Identifier.

Valid range is 1-256.

list / elements=dictionary / required

List of Ethernet ports to include in the port channel.

string / required

Port ID to include in the port channel.

Can be a regular port (e.g., 36) or aggregate port (e.g., ‘49/2’).

Aggregate ports use breakout port syntax where ‘49/2’ means sub-port 2 of port 49.

string

Whether to create/update or delete the port channel.

Choices:

  • "present" ← (default)

  • "absent"

string

User-defined label for the port channel.

User label must be between 0 and 128 alphanumeric characters.

list / elements=dictionary

List of Ethernet Uplink port configurations.

Ethernet Uplink ports connect to upstream network switches.

string

Administrative speed of the port.

Speed restrictions apply based on port numbers.

Choices:

  • "Auto" ← (default)

  • "1Gbps"

  • "10Gbps"

  • "25Gbps"

  • "40Gbps"

  • "100Gbps"

list / elements=string

List of Ethernet Network Group Policy names.

The Ethernet Network Group Policy specifies a set of VLANs to allow on the uplink port.

The specified VLAN set must be either identical or disjoint from those specified on other uplink interfaces.

Ensure that the VLANs are defined in the VLAN Policy and ‘Auto Allow on Uplinks’ option is disabled.

Note, default VLAN-1 is auto allowed and can be specified as the native VLAN.

string

Forward Error Correction (FEC) mode.

Choices:

  • "Auto" ← (default)

  • "Off"

string

Flow Control Policy name.

string

Link Control Policy name.

string

MAC Security Policy name.

The relationship to the Media Access Control Security (MACsec) Policy.

string / required

Port ID to configure as Ethernet Uplink.

Can be a regular port (e.g., 14) or aggregate port (e.g., ‘49/1’).

string

Whether to create/update or delete the Ethernet Uplink port.

Choices:

  • "present" ← (default)

  • "absent"

string

User-defined label for the port.

User label must be between 0 and 128 alphanumeric characters.

fc_port_mode

dictionary

Configure Fibre Channel port mode for a range of ports.

This converts Ethernet ports to Fibre Channel ports.

Only one FC port mode configuration is allowed per policy.

Device-specific FC port ranges apply (see device_model documentation).

For UCS-FI-6536 and UCSX-S9108-100G, fc_port_mode is not supported.

FC functionality is available through breakout ports only. If specified, this parameter will be ignored with a warning.

port_id_end

integer / required

Ending port ID for FC mode configuration.

Valid values depend on device model and supported FC range.

For UCS-FI-6454/64108, valid values are 4, 8, 12, or 16.

For UCS-FI-6664, must be within range 25-40.

Not applicable for UCS-FI-6536 and UCSX-S9108-100G (use breakout ports for FC).

port_id_start

integer

Starting port ID for FC mode configuration.

For UCS-FI-6454/64108, must be 1 (minimum FC port).

For UCS-FI-6664, must be 25 (minimum FC port).

Not applicable for UCS-FI-6536 and UCSX-S9108-100G (use breakout ports for FC).

Default: 1

state

string

Whether to enable or disable FC port mode.

Choices:

  • "present" ← (default)

  • "absent"

fc_storage_ports

list / elements=dictionary

List of FC Storage port configurations.

FC Storage ports are used for direct storage connectivity.

For UCS-FI-6454, UCS-FI-64108, UCS-FI-6664 requires fc_port_mode configuration.

For UCS-FI-6536, UCSX-S9108-100G uses FC breakout ports (no fc_port_mode needed).

admin_speed

string

Administrative speed of the FC port.

Choices:

  • "8Gbps" ← (default)

  • "16Gbps"

  • "32Gbps"

port_id

string / required

Port ID to configure as FC Storage.

Must be within the FC port mode range.

Can be a regular port (e.g., 2) or aggregate port for FC breakout (e.g., ‘36/2’).

For aggregate ports, the base port must be configured as FC breakout.

state

string

Whether to create/update or delete the FC Storage port.

Choices:

  • "present" ← (default)

  • "absent"

user_label

string

User-defined label for the port.

User label must be between 0 and 128 alphanumeric characters.

vsan_id

integer / required

VSAN ID associated to the FC Storage port.

list / elements=dictionary

List of FC uplink port channel configurations.

Port channels aggregate multiple FC ports into a single logical link.

Only applicable when fc_port_mode is configured.

string

Administrative speed of the FC port channel.

Choices:

  • "8Gbps"

  • "16Gbps" ← (default)

  • "32Gbps"

integer / required

Port Channel Identifier.

Valid range is 1-256.

list / elements=dictionary / required

List of FC ports to include in the port channel.

Ports must be within the FC port mode range.

string / required

FC port ID to include in the port channel.

string

Whether to create/update or delete the port channel.

Choices:

  • "present" ← (default)

  • "absent"

string

User-defined label for the port channel.

User label must be between 0 and 128 alphanumeric characters.

integer

VSAN ID associated to the FC port channel.

Default: 1

list / elements=dictionary

List of FC Uplink port configurations.

FC Uplink ports are used for Fibre Channel connectivity to storage networks.

For UCS-FI-6454, UCS-FI-64108, UCS-FI-6664 requires fc_port_mode configuration.

For UCS-FI-6536, UCSX-S9108-100G uses FC breakout ports (no fc_port_mode needed).

string

Administrative speed of the FC port.

Choices:

  • "Auto" ← (default)

  • "8Gbps"

  • "16Gbps"

  • "32Gbps"

string / required

Port ID to configure as FC Uplink.

Must be within the FC port mode range.

Can be a regular port (e.g., 1) or aggregate port for FC breakout (e.g., ‘36/1’).

For aggregate ports, the base port must be configured as FC breakout.

string

Whether to create/update or delete the FC Uplink port.

Choices:

  • "present" ← (default)

  • "absent"

string

User-defined label for the port.

User label must be between 0 and 128 alphanumeric characters.

integer / required

Virtual SAN Identifier associated to the FC port.

list / elements=dictionary

List of FCoE uplink port channel configurations.

Port channels provide Fibre Channel over Ethernet connectivity.

string

Administrative speed of the port channel.

Choices:

  • "Auto" ← (default)

  • "1Gbps"

  • "10Gbps"

  • "25Gbps"

  • "40Gbps"

  • "100Gbps"

string

Forward Error Correction (FEC) mode.

Choices:

  • "Auto" ← (default)

  • "Off"

string

Link Aggregation Policy name to associate.

The relationship to the Link Aggregation Policy.

string

Link Control Policy name to associate.

integer / required

Port Channel Identifier.

Valid range is 1-256.

list / elements=dictionary / required

List of Ethernet ports to include in the port channel.

string / required

Port ID to include in the port channel.

Can be a regular port (e.g., 36) or aggregate port (e.g., ‘49/2’).

Aggregate ports use breakout port syntax where ‘49/2’ means sub-port 2 of port 49.

string

Whether to create/update or delete the port channel.

Choices:

  • "present" ← (default)

  • "absent"

string

User-defined label for the port channel.

User label must be between 0 and 128 alphanumeric characters.

list / elements=dictionary

List of FCoE Uplink port configurations.

FCoE Uplink ports provide Fibre Channel over Ethernet connectivity.

string

Administrative speed of the port.

Choices:

  • "Auto" ← (default)

  • "1Gbps"

  • "10Gbps"

  • "25Gbps"

  • "40Gbps"

  • "100Gbps"

string

Forward Error Correction (FEC) mode.

Choices:

  • "Auto" ← (default)

  • "Off"

string

Link Control Policy name.

string / required

Port ID to configure as FCoE Uplink.

Can be a regular port (e.g., 15) or aggregate port (e.g., ‘49/1’).

string

Whether to create/update or delete the FCoE Uplink port.

Choices:

  • "present" ← (default)

  • "absent"

string

User-defined label for the port.

User label must be between 0 and 128 alphanumeric characters.

name

string / required

The name assigned to the Port Policy.

Must be unique within the organization.

The name must be between 1 and 62 alphanumeric characters, allowing special characters :-_.

organization

string

The name of the Organization this resource is assigned to.

Policies created within a Custom Organization are applicable only to devices in the same Organization.

Use ‘default’ for the default organization.

Default: "default"

pin_groups

list / elements=dictionary

List of pin group configurations (both LAN and SAN).

Pin groups control traffic distribution across uplinks.

LAN pin groups are used for Ethernet uplink ports and port channels.

SAN pin groups are used for FCoE uplink ports and port channels.

name

string / required

Name of the pin group.

pin_group_type

string / required

Type of pin group.

Use ‘lan’ for Ethernet uplink ports and port channels.

Use ‘san’ for FCoE uplink ports and port channels.

Choices:

  • "lan"

  • "san"

state

string

Whether to create/update or delete the pin group.

Choices:

  • "present" ← (default)

  • "absent"

target_interface_name

string / required

Name or identifier of the target interface.

For pc, this should be the pc_id of an uplink port channel.

For port, this should be the port identifier (e.g., ‘14’ or ‘49/1’).

target_interface_type

string / required

Type of target interface.

Choices:

  • "pc"

  • "port"

server_ports

list / elements=dictionary

List of server port configurations.

Server ports connect to server adapters.

fec

string

Forward Error Correction (FEC) mode.

Choices:

  • "Auto" ← (default)

  • "Cl74"

manual_numbering

boolean

Enable manual numbering on the port.

When true, preferred_device_type defaults to ‘Chassis’ and preferred_device_id becomes required.

Cannot be true for aggregate ports (e.g., ‘49/1’) as manual numbering is not supported on breakout ports.

Chassis and Rack Servers are numbered automatically as discovered.

Chassis are numbered separately from rack servers. Enable this to allow manual setting of discovered device IDs.

Choices:

  • false ← (default)

  • true

port_id

string / required

Port ID to configure as server port.

Can be a regular port (e.g., 49) or aggregate port (e.g., ‘49/2’).

Aggregate ports use breakout port syntax where ‘49/2’ means sub-port 2 of port 49.

preferred_device_id

integer

Preferred device ID when manual chassis/server numbering is enabled.

Required when manual_numbering is true or when preferred_device_type is specified.

preferred_device_type

string

Preferred device type when manual chassis/server numbering is enabled.

Defaults to ‘Chassis’ when manual_numbering is true.

Choices:

  • "Chassis"

  • "RackServer"

state

string

Whether to create/update or delete the server port configuration.

Choices:

  • "present" ← (default)

  • "absent"

user_label

string

User-defined label for the port.

User label must be between 0 and 128 alphanumeric characters.

state

string

If present, will verify the resource is present and will create if needed.

If absent, will verify the resource is absent and will delete if needed.

Choices:

  • "present" ← (default)

  • "absent"

tags

list / elements=dictionary

List of tags in Key:<user-defined key> Value:<user-defined value> format.

use_proxy

boolean

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

Choices:

  • false

  • true ← (default)

validate_certs

boolean

Boolean control for verifying the api_uri TLS certificate

Choices:

  • false

  • true ← (default)

Examples

- name: Create a Port Policy with breakout ports and server ports
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "port-policy-example"
    description: "Example port policy with various configurations"
    device_model: "UCS-FI-6454"
    tags:
      - Key: "Environment"
        Value: "Production"
    breakout_ports:
      - port_id: 49
        custom_mode: "BreakoutEthernet25G"
        state: present
    server_ports:
      - port_id: 1
        fec: "Auto"
        manual_numbering: false
        user_label: "Server Port 1"
        state: present
      - port_id: 2
        fec: "Auto"
        manual_numbering: true
        preferred_device_type: "RackServer"
        preferred_device_id: 2
        user_label: "Server Port with Manual Numbering"
        state: present
    state: present

- name: Create a Port Policy with Ethernet uplink port channel
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "port-policy-with-pc"
    description: "Port policy with port channel configurations"
    device_model: "UCS-FI-6454"
    ethernet_uplink_port_channels:
      - pc_id: 123
        admin_speed: "25Gbps"
        fec: "Auto"
        user_label: "Uplink PC 123"
        ports:
          - port_id: 36
          - port_id: 37
          - port_id: "49/1"
          - port_id: "49/2"
        eth_network_group_policy_names:
          - "default-network-group"
        flow_control_policy_name: "default-flow-control"
        link_aggregation_policy_name: "default-link-aggregation"
        link_control_policy_name: "default-link-control"
        state: present
    state: present

- name: Create a Port Policy with FC uplink port channel
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fc-port-channel-policy"
    device_model: "UCS-FI-6454"
    fc_port_mode:
      port_id_end: 8
      state: present
    fc_uplink_port_channels:
      - pc_id: 13
        admin_speed: "16Gbps"
        vsan_id: 1
        ports:
          - port_id: 1
          - port_id: 2
          - port_id: 3
          - port_id: 4
        state: present
    state: present

- name: Create a Port Policy with appliance port channel
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "appliance-pc-policy"
    device_model: "UCS-FI-6454"
    appliance_port_channels:
      - pc_id: 21
        admin_speed: "Auto"
        fec: "Auto"
        priority: "Best Effort"
        mode: "trunk"
        user_label: "Storage PC"
        ports:
          - port_id: 11
          - port_id: 12
        eth_network_group_policy_name: "storage-network-group"
        eth_network_control_policy_name: "storage-network-control"
        link_aggregation_policy_name: "default-link-aggregation"
        state: present
    state: present

- name: Create a Port Policy with LAN pin groups
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "port-policy-with-pin-groups"
    description: "Port policy with LAN pin group configuration"
    device_model: "UCS-FI-6454"
    breakout_ports:
      - port_id: 49
        custom_mode: "BreakoutEthernet25G"
        state: present
    ethernet_uplink_port_channels:
      - pc_id: 1
        admin_speed: "Auto"
        ports:
          - port_id: 53
          - port_id: 54
        eth_network_group_policy_names:
          - "default-network-group"
        state: present
    ethernet_uplink_ports:
      - port_id: 14
        admin_speed: "Auto"
        fec: "Auto"
        eth_network_group_policy_name:
          - "default-network-group"
        state: present
    fcoe_uplink_ports:
      - port_id: "49/1"
        admin_speed: "Auto"
        fec: "Auto"
        state: present
    pin_groups:
      - name: "pin-group-1"
        pin_group_type: "lan"
        target_interface_type: "pc"
        target_interface_name: "1"
        state: present
      - name: "pin-group-2"
        pin_group_type: "lan"
        target_interface_type: "port"
        target_interface_name: "14"
        state: present
      - name: "pin-group-3"
        pin_group_type: "san"
        target_interface_type: "port"
        target_interface_name: "49/1"
        state: present
    state: present

- name: Update Port Policy - manage resource states
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "port-policy-update"
    device_model: "UCS-FI-6454"
    server_ports:
      - port_id: 3
        user_label: "New Server Port"
        state: present
      - port_id: 4
        state: absent
    state: present

- name: Create a Port Policy with Fibre Channel ports 1-16
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "fc-port-policy"
    device_model: "UCS-FI-6454"
    fc_port_mode:
      port_id_end: 16
      state: present
    fc_uplink_ports:
      - port_id: 1
        admin_speed: "8Gbps"
        vsan_id: 2
        user_label: "FC Uplink 1"
        state: present
      - port_id: "49/1"
        admin_speed: "16Gbps"
        vsan_id: 3
        user_label: "FC Uplink Aggregate"
        state: present
    fc_storage_ports:
      - port_id: 2
        admin_speed: "8Gbps"
        vsan_id: 5
        user_label: "FC Storage 2"
        state: present
    state: present

- name: Create a Port Policy with Appliance and Ethernet Uplink ports
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "mixed-port-policy"
    device_model: "UCS-FI-6454"
    appliance_ports:
      - port_id: 13
        admin_speed: "10Gbps"
        fec: "Auto"
        priority: "Best Effort"
        mode: "trunk"
        eth_network_group_policy_name: "default-network-group"
        eth_network_control_policy_name: "default-network-control"
        user_label: "Storage Appliance"
        state: present
    ethernet_uplink_ports:
      - port_id: 14
        admin_speed: "Auto"
        fec: "Auto"
        eth_network_group_policy_name:
          - "default-network-group"
        flow_control_policy_name: "default-flow-control"
        link_control_policy_name: "default-link-control"
        state: present
    fcoe_uplink_ports:
      - port_id: 15
        admin_speed: "Auto"
        fec: "Auto"
        link_control_policy_name: "default-link-control"
        user_label: "FCoE Uplink"
        state: present
    state: present

- name: Delete a Port Policy
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "port-policy-to-delete"
    state: absent

# Device Model Specific Examples

- name: UCS-FI-64108 Port Policy with device-specific features
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "UCS-FI-64108-policy"
    device_model: "UCS-FI-64108"
    description: "Port policy for UCS-FI-64108 with 108 ports"
    breakout_ports:
      - port_id: 97
        custom_mode: "BreakoutEthernet25G"
        state: present
      - port_id: 108
        custom_mode: "BreakoutEthernet10G"
        state: present
    ethernet_uplink_ports:
      - port_id: 89
        admin_speed: "1Gbps"
        state: present
      - port_id: 97
        admin_speed: "100Gbps"
        state: present
    state: present

- name: UCS-FI-6536 Port Policy with FC breakout support
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "UCS-FI-6536-policy"
    device_model: "UCS-FI-6536"
    description: "Port policy for UCS-FI-6536 with FC breakout"
    breakout_ports:
      - port_id: 36
        custom_mode: "BreakoutFibreChannel16G"
        state: present
      - port_id: 35
        custom_mode: "BreakoutFibreChannel32G"
        state: present
      - port_id: 1
        custom_mode: "BreakoutEthernet25G"
        state: present
    ethernet_uplink_ports:
      - port_id: 9
        admin_speed: "1Gbps"
        state: present
    fc_uplink_ports:
      - port_id: "36/1"
        admin_speed: "16Gbps"
        vsan_id: 1
        state: present
    fc_storage_ports:
      - port_id: "35/2"
        admin_speed: "32Gbps"
        vsan_id: 2
        state: present
    state: present

- name: UCS-FI-6664 Port Policy without breakout support
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "UCS-FI-6664-policy"
    device_model: "UCS-FI-6664"
    description: "Port policy for UCS-FI-6664 - no breakout support"
    fc_port_mode:
      port_id_start: 25
      port_id_end: 40
      state: present
    ethernet_uplink_ports:
      - port_id: 1
        admin_speed: "100Gbps"
        state: present
      - port_id: 50
        admin_speed: "40Gbps"
        state: present
    fc_uplink_ports:
      - port_id: 25
        admin_speed: "32Gbps"
        vsan_id: 1
        state: present
    state: present

- name: UCSX-S9108-100G Port Policy with FC breakout
  cisco.intersight.intersight_port_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "UCSX-S9108-100G-policy"
    device_model: "UCSX-S9108-100G"
    description: "Port policy for UCSX-S9108-100G with FC breakout"
    breakout_ports:
      - port_id: 1
        custom_mode: "BreakoutFibreChannel16G"
        state: present
      - port_id: 2
        custom_mode: "BreakoutFibreChannel8G"
        state: present
    ethernet_uplink_ports:
      - port_id: 7
        admin_speed: "1Gbps"
        state: present
      - port_id: 8
        admin_speed: "1Gbps"
        state: present
    fc_uplink_ports:
      - port_id: "1/1"
        admin_speed: "16Gbps"
        vsan_id: 1
        state: present
      - port_id: "2/3"
        admin_speed: "8Gbps"
        vsan_id: 1
        state: present
    state: present

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

api_response

dictionary

The API response output returned by the specified resource.

Returned: always

Sample: {"api_response": {"BreakoutPorts": [{"CustomMode": "BreakoutEthernet25G", "PortIdEnd": 49, "PortIdStart": 49, "SlotId": 1}], "DeviceModel": "UCS-FI-6454", "Name": "port-policy-example", "ObjectType": "fabric.PortPolicy", "ServerPorts": [{"Fec": "Auto", "PortId": 1, "SlotId": 1, "UserLabel": "Server Port 1"}], "Tags": [{"Key": "Environment", "Value": "Production"}]}}

Authors

  • Ron Gershburg (@rgershbu)