cisco.intersight.intersight_ethernet_network_control_policy module – Ethernet Network Control Policy configuration for Cisco Intersight

Note

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

Synopsis

  • Manages Ethernet Network Control Policy configuration on Cisco Intersight.

  • A policy to configure network control settings for ethernet connections on Cisco Intersight managed servers.

  • This policy is applicable only for UCS Servers (FI-Attached).

  • 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"

cdp_enabled

boolean

Enables the CDP on an interface.

Cisco Discovery Protocol (CDP) is a proprietary Data Link Layer protocol developed by Cisco Systems.

Choices:

  • false ← (default)

  • true

description

aliases: descr

string

The user-defined description for the Ethernet Network Control Policy.

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

forge_mac

string

Determines if the MAC forging is allowed or denied on an interface.

allow - Allows MAC forging on the interface.

deny - Denies MAC forging on the interface.

Choices:

  • "allow" ← (default)

  • "deny"

lldp_receive_enabled

boolean

Determines if the LLDP frames can be received by an interface on the switch.

Link Layer Discovery Protocol (LLDP) is a vendor-neutral link layer protocol.

Choices:

  • false ← (default)

  • true

lldp_transmit_enabled

boolean

Determines if the LLDP frames can be transmitted by an interface on the switch.

Link Layer Discovery Protocol (LLDP) is a vendor-neutral link layer protocol.

Choices:

  • false ← (default)

  • true

mac_registration_mode

string

Determines the MAC addresses that have to be registered with the switch.

nativeVlanOnly - Register only the MAC addresses learned in the native VLAN.

allVlans - Register the MAC addresses learned in all VLANs.

Choices:

  • "nativeVlanOnly" ← (default)

  • "allVlans"

name

string / required

The name assigned to the Ethernet Network Control Policy.

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.

Profiles, Policies, and Pools that are created within a Custom Organization are applicable only to devices in the same Organization.

Default: "default"

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.

string

Determines the state of the virtual interface (vethernet / vfc) on the switch when a suitable uplink is not pinned.

linkDown - The vethernet will go down.

warning - The vethernet will remain up and will not fail over if uplink connectivity is lost.

Important! If the Action on Uplink is set to Warning, the switch will not fail over if uplink connectivity is lost.

Choices:

  • "linkDown" ← (default)

  • "warning"

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 an Ethernet Network Control Policy with default settings
  cisco.intersight.intersight_ethernet_network_control_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "default-network-control-policy"
    description: "Default Ethernet Network Control policy"
    state: present

- name: Create an Ethernet Network Control Policy with CDP and LLDP enabled
  cisco.intersight.intersight_ethernet_network_control_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "discovery-enabled-policy"
    description: "Network Control policy with discovery protocols enabled"
    tags:
      - Key: "Environment"
        Value: "Production"
    cdp_enabled: true
    mac_registration_mode: "allVlans"
    uplink_fail_action: "warning"
    forge_mac: "deny"
    lldp_transmit_enabled: true
    lldp_receive_enabled: true
    state: present

- name: Create an Ethernet Network Control Policy with strict security settings
  cisco.intersight.intersight_ethernet_network_control_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "secure-network-control-policy"
    description: "Secure Network Control policy with MAC forging denied"
    cdp_enabled: false
    mac_registration_mode: "nativeVlanOnly"
    uplink_fail_action: "linkDown"
    forge_mac: "deny"
    lldp_transmit_enabled: false
    lldp_receive_enabled: false
    state: present

- name: Delete an Ethernet Network Control Policy
  cisco.intersight.intersight_ethernet_network_control_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "secure-network-control-policy"
    state: absent

Return Values

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

Key

Description

api_repsonse

dictionary

The API response output returned by the specified resource.

Returned: always

Sample: {"api_response": {"CdpEnabled": true, "ForgeMac": "deny", "LldpSettings": {"ReceiveEnabled": true, "TransmitEnabled": true}, "MacRegistrationMode": "allVlans", "Name": "discovery-enabled-policy", "ObjectType": "fabric.EthNetworkControlPolicy", "Tags": [{"Key": "Environment", "Value": "Production"}], "UplinkFailAction": "warning"}}

Authors

  • Ron Gershburg (@rgershbu)