cisco.intersight.intersight_iscsi_boot_policy module – Manage iSCSI Boot 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_iscsi_boot_policy.

Synopsis

  • Create, update, and delete iSCSI Boot Policies on Cisco Intersight.

  • iSCSI boot policies define how servers boot from iSCSI targets using IPv4 or IPv6 protocols.

  • Supports automatic target discovery (Auto) and manual configuration (Static) with DHCP, Pool, or Static IP sources.

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

auto_targetvendor_name

string

Auto target interface that is represented via the Initiator name or the DHCP vendor ID.

The vendor ID can be up to 64 characters.

Required when target_source_type is auto and iscsi_ip_type is ipv4.

chap

dictionary

CHAP authentication parameters for iSCSI Target.

Provide user_id and password to enable CHAP authentication.

Leave empty or omit to disable CHAP authentication.

password

string / required

CHAP password for authentication.

user_id

string / required

CHAP username for authentication.

description

aliases: descr

string

The user-defined description for the iSCSI Boot Policy.

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

initiator_ip_pool_name

string

Name of the IP pool to use for initiator IP address assignment.

Required when initiator_ip_source is pool.

initiator_ip_source

string

Method for assigning initiator IP address.

dhcp - Obtain IP address automatically via DHCP.

pool - Use an IP pool for address assignment.

static - Manually configure static IP address.

Choices:

  • "dhcp" ← (default)

  • "pool"

  • "static"

initiator_static_ipv4_address

string

Static IPv4 address provided for iSCSI Initiator.

Required when initiator_ip_source is static and iscsi_ip_type is ipv4.

initiator_static_ipv4_gateway

string

IP address of the default IPv4 gateway.

Required when initiator_ip_source is static and iscsi_ip_type is ipv4.

initiator_static_ipv4_netmask

string

A subnet mask is a 32-bit number that masks an IP address and divides the IP address into network address and host address.

Required when initiator_ip_source is static and iscsi_ip_type is ipv4.

initiator_static_ipv4_primary_dns

string

IP Address of the primary Domain Name System (DNS) server.

Optional when initiator_ip_source is static and iscsi_ip_type is ipv4.

initiator_static_ipv4_secondary_dns

string

IP Address of the secondary Domain Name System (DNS) server.

Optional when initiator_ip_source is static and iscsi_ip_type is ipv4.

initiator_static_ipv6_address

string

Static IPv6 address provided for iSCSI Initiator.

Required when initiator_ip_source is static and iscsi_ip_type is ipv6.

initiator_static_ipv6_gateway

string

IP address of the default IPv6 gateway.

Required when initiator_ip_source is static and iscsi_ip_type is ipv6.

initiator_static_ipv6_prefix

integer

The integer length of the prefix that masks the IP address and divides it into network and host addresses.

Required when initiator_ip_source is static and iscsi_ip_type is ipv6.

iscsi_adapter_policy_name

string

Relationship to the iSCSI Adapter Policy.

Name of the iSCSI adapter policy to associate with this boot policy.

Optional for all configurations.

iscsi_ip_type

string

Type of the IP address requested for iSCSI vNIC - IPv4/IPv6.

ipv4 supports both auto and static target source types.

ipv6 only supports static target source type (not auto).

Both ipv4 and ipv6 support dhcp, pool, and static initiator IP sources.

Choices:

  • "ipv4" ← (default)

  • "ipv6"

mutual_chap

dictionary

Mutual CHAP authentication parameters for iSCSI Initiator.

Two-way CHAP mechanism.

Provide user_id and password to enable Mutual CHAP authentication.

Leave empty or omit to disable Mutual CHAP authentication.

password

string / required

Mutual CHAP password for authentication.

user_id

string / required

Mutual CHAP username for authentication.

name

string / required

The name assigned to the iSCSI Boot 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"

primary_target_policy_name

string

Specifies Target Profile information for iSCSI Boot.

Name of the primary iSCSI static target policy.

Required when target_source_type is static.

secondary_target_policy_name

string

Specifies Target Profile information for iSCSI Boot.

Optional when target_source_type is static.

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.

target_source_type

string

Target discovery method.

auto - Automatic target discovery using DHCP vendor ID/IQN.

static - Manual target configuration using target policies.

Choices:

  • "auto"

  • "static" ← (default)

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 iSCSI Boot Policy with Auto discovery (IPv4)
  cisco.intersight.intersight_iscsi_boot_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "iscsi-boot-auto"
    description: "iSCSI boot policy with auto discovery"
    iscsi_ip_type: "ipv4"
    target_source_type: "auto"
    auto_targetvendor_name: "iqn.1991-05.com.cisco"
    iscsi_adapter_policy_name: "iscsi-adapter-policy"
    initiator_ip_source: "dhcp"
    state: present

- name: Create iSCSI Boot Policy with Static targets and DHCP initiator (IPv4)
  cisco.intersight.intersight_iscsi_boot_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "iscsi-boot-static-dhcp"
    description: "iSCSI boot policy with static targets"
    iscsi_ip_type: "ipv4"
    target_source_type: "static"
    primary_target_policy_name: "primary-target-policy"
    secondary_target_policy_name: "secondary-target-policy"
    chap:
      user_id: "chapuser"
      password: "chappassword123"
    mutual_chap:
      user_id: "mutualuser"
      password: "mutualpassword123"
    initiator_ip_source: "dhcp"
    state: present

- name: Create iSCSI Boot Policy with Pool-based initiator IP
  cisco.intersight.intersight_iscsi_boot_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "iscsi-boot-pool"
    description: "iSCSI boot policy with IP pool"
    iscsi_ip_type: "ipv4"
    target_source_type: "static"
    primary_target_policy_name: "primary-target-policy"
    initiator_ip_source: "pool"
    initiator_ip_pool_name: "iscsi-ip-pool"
    state: present

- name: Create iSCSI Boot Policy with Static IPv4 configuration
  cisco.intersight.intersight_iscsi_boot_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "iscsi-boot-static-ipv4"
    description: "iSCSI boot policy with static IPv4"
    iscsi_ip_type: "ipv4"
    target_source_type: "static"
    primary_target_policy_name: "primary-target-policy"
    initiator_ip_source: "static"
    initiator_static_ipv4_address: "192.168.1.100"
    initiator_static_ipv4_netmask: "255.255.255.0"
    initiator_static_ipv4_gateway: "192.168.1.1"
    initiator_static_ipv4_primary_dns: "8.8.8.8"
    initiator_static_ipv4_secondary_dns: "8.8.4.4"
    tags:
      - Key: Environment
        Value: Production
    state: present

- name: Create iSCSI Boot Policy with Static IPv6 configuration
  cisco.intersight.intersight_iscsi_boot_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "iscsi-boot-static-ipv6"
    description: "iSCSI boot policy with static IPv6"
    iscsi_ip_type: "ipv6"
    target_source_type: "static"
    primary_target_policy_name: "primary-target-policy-ipv6"
    initiator_ip_source: "static"
    initiator_static_ipv6_address: "2001:db8::1"
    initiator_static_ipv6_prefix: 64
    initiator_static_ipv6_gateway: "2001:db8::ffff"
    state: present

- name: Create iSCSI Boot Policy with IPv6 DHCP initiator
  cisco.intersight.intersight_iscsi_boot_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "iscsi-boot-ipv6-dhcp"
    description: "iSCSI boot policy with IPv6 DHCP"
    iscsi_ip_type: "ipv6"
    target_source_type: "static"
    primary_target_policy_name: "primary-target-policy-ipv6"
    initiator_ip_source: "dhcp"
    state: present

- name: Create iSCSI Boot Policy with IPv6 Pool initiator
  cisco.intersight.intersight_iscsi_boot_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: "default"
    name: "iscsi-boot-ipv6-pool"
    description: "iSCSI boot policy with IPv6 pool"
    iscsi_ip_type: "ipv6"
    target_source_type: "static"
    primary_target_policy_name: "primary-target-policy-ipv6"
    initiator_ip_source: "pool"
    initiator_ip_pool_name: "ipv6-ip-pool"
    state: present

- name: Delete iSCSI Boot Policy
  cisco.intersight.intersight_iscsi_boot_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: "iscsi-boot-auto"
    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": {"AutoTargetvendorName": "iqn.1991-05.com.cisco", "InitiatorIpSource": "DHCP", "IscsiIpType": "IPv4", "Moid": "1234567890abcdef12345678", "Name": "iscsi-boot-auto", "ObjectType": "vnic.IscsiBootPolicy", "Tags": [{"Key": "Environment", "Value": "Production"}], "TargetSourceType": "Auto"}}

Authors

  • Ron Gershburg (@rgershbu)