cisco.intersight.intersight_fibre_channel_network_policy module – Manage Fibre Channel Network Policies for Cisco Intersight

Note

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

Synopsis

  • Create, update, and delete Fibre Channel Network Policies on Cisco Intersight.

  • Fibre Channel Network policies configure VSAN settings for Fibre Channel virtual interfaces.

  • These policies control the default VLAN ID and VSAN ID assignments for FC networks.

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

default_vlan

integer

The default VLAN ID for the Fibre Channel network.

Valid range is 0 to 4094.

A value of 0 means the VLAN is not configured.

Default: 0

description

aliases: descr

string

The user-defined description for the Fibre Channel Network Policy.

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

name

string / required

The name assigned to the Fibre Channel Network 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"

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)

vsan_id

integer

The VSAN (Virtual Storage Area Network) ID for the Fibre Channel network.

Valid range is 1 to 4094.

Default: 1

Examples

- name: Create Fibre Channel Network Policy with default settings
  cisco.intersight.intersight_fibre_channel_network_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fc-network-default"
    description: "Fibre Channel Network policy with default values"
    state: present

- name: Create Fibre Channel Network Policy with custom VSAN settings
  cisco.intersight.intersight_fibre_channel_network_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fc-network-vsan100"
    description: "Fibre Channel Network policy for VSAN 100"
    default_vlan: 100
    vsan_id: 100
    tags:
      - Key: Environment
        Value: Production
    state: present

- name: Create Fibre Channel Network Policy with VLAN and different VSAN
  cisco.intersight.intersight_fibre_channel_network_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "Engineering"
    name: "fc-network-custom"
    description: "Custom Fibre Channel Network policy"
    default_vlan: 200
    vsan_id: 300
    state: present

- name: Create Fibre Channel Network Policy with maximum VSAN ID
  cisco.intersight.intersight_fibre_channel_network_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fc-network-max-vsan"
    description: "Fibre Channel Network policy with maximum VSAN ID"
    default_vlan: 4094
    vsan_id: 4094
    state: present

- name: Update Fibre Channel Network Policy description
  cisco.intersight.intersight_fibre_channel_network_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fc-network-default"
    description: "Updated Fibre Channel Network policy description"
    state: present

- name: Delete Fibre Channel Network Policy
  cisco.intersight.intersight_fibre_channel_network_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "fc-network-default"
    state: absent

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": {"Description": "Fibre Channel Network policy for VSAN 100", "Moid": "1234567890abcdef12345678", "Name": "fc-network-vsan100", "ObjectType": "vnic.FcNetworkPolicy", "Organization": {"Moid": "abcdef1234567890abcdef12", "ObjectType": "organization.Organization"}, "Tags": [{"Key": "Environment", "Value": "Production"}], "VsanSettings": {"DefaultVlanId": 100, "Id": 100}}}

Authors

  • Ron Gershburg (@rgershbu)