dellemc.unity.dellemc_unity_host (1.2.1) — module

Manage Host operations on Unity

| "added in version" 1.1.0 of dellemc.unity"

Authors: Rajshree Khare (@kharer5) <ansible.team@dell.com>

preview | supported by community

Install collection

Install with ansible-galaxy collection install dellemc.unity:==1.2.1


Add to requirements.yml

  collections:
    - name: dellemc.unity
      version: 1.2.1

Description

The Host module contains the following operations Creation of a Host. Addition of initiators to Host. Removal of initiators from Host. Modification of host attributes. Get details of a Host. Deletion of a Host.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create empty Host
  dellemc.unity.dellemc_unity_host:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    host_name: "ansible-test-host"
    host_os: "Linux"
    description: "ansible-test-host"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create Host with Initiators
  dellemc.unity.dellemc_unity_host:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    host_name: "ansible-test-host-1"
    host_os: "Linux"
    description: "ansible-test-host-1"
    initiators:
      - "iqn.1994-05.com.redhat:c38e6e8cfd81"
      - "20:00:00:90:FA:13:81:8D:10:00:00:90:FA:13:81:8D"
    initiator_state: "present-in-host"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Host using host_id
  dellemc.unity.dellemc_unity_host:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    host_id: "Host_253"
    new_host_name: "ansible-test-host-2"
    host_os: "Mac OS"
    description: "Ansible tesing purpose"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add Initiators to Host
  dellemc.unity.dellemc_unity_host:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    host_name: "ansible-test-host-2"
    initiators:
      - "20:00:00:90:FA:13:81:8C:10:00:00:90:FA:13:81:8C"
    initiator_state: "present-in-host"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get Host details using host_name
  dellemc.unity.dellemc_unity_host:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    host_name: "ansible-test-host-2"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get Host details using host_id
  dellemc.unity.dellemc_unity_host:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    host_id: "Host_253"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete Host
  dellemc.unity.dellemc_unity_host:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    host_name: "ansible-test-host-2"
    state: "absent"

Inputs

    
port:
    default: 443
    description:
    - Port number through which communication happens with Unity management server.
    required: false
    type: int

state:
    choices:
    - present
    - absent
    description:
    - State of the host.
    required: true
    type: str

host_id:
    description:
    - Unique identifier of the host.
    - host_id is auto generated during creation.
    - Except create, all other operations require either host_id or host_name.
    type: str

host_os:
    choices:
    - AIX
    - Citrix XenServer
    - HP-UX
    - IBM VIOS
    - Linux
    - Mac OS
    - Solaris
    - VMware ESXi
    - Windows Client
    - Windows Server
    description:
    - Operating system running on the host.
    type: str

password:
    description:
    - The password of the Unity management server.
    required: true
    type: str

username:
    description:
    - The username of the Unity management server.
    required: true
    type: str

host_name:
    description:
    - Name of the host.
    - Mandatory for host creation.
    type: str

initiators:
    description:
    - List of initiators to be added/removed to/from host.
    elements: str
    type: list

verifycert:
    choices:
    - true
    - false
    default: true
    description:
    - Boolean variable to specify whether or not to validate SSL certificate.
    - True - Indicates that the SSL certificate should be verified.
    - False - Indicates that the SSL certificate should not be verified.
    required: false
    type: bool

description:
    description:
    - Host description.
    type: str

new_host_name:
    description:
    - New name for the host.
    - Only required in rename host operation.
    type: str

unispherehost:
    description:
    - IP or FQDN of the Unity management server.
    required: true
    type: str

initiator_state:
    choices:
    - present-in-host
    - absent-in-host
    description:
    - State of the initiator.
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  type: bool
host_details:
  contains:
    description:
      description: Description about the host.
      type: str
    fc_host_initiators:
      contains:
        UnityHostInitiatorList:
          description: FC initiators with system generated unique hash value.
          type: complex
      description: Details of the FC initiators associated with the host.
      type: complex
    id:
      description: The system ID given to the host.
      type: str
    iscsi_host_initiators:
      contains:
        UnityHostInitiatorList:
          description: ISCSI initiators with sytem genrated unique hash value.
          type: complex
      description: Details of the ISCSI initiators associated with the host.
      type: complex
    name:
      description: The name of the host.
      type: str
    os_type:
      description: Operating system running on the host.
      type: str
    type:
      description: HostTypeEnum of the host.
      type: str
  description: Details of the host.
  returned: When host exists.
  type: complex