dellemc / dellemc.powerstore / 1.3.0 / module / dellemc_powerstore_hostgroup Manage host group on PowerStore Storage System. | "added in version" 1.0.0 of dellemc.powerstore" Authors: Manisha Agrawal (@agrawm3) <ansible.team@dell.com> preview | supported by communitydellemc.powerstore.dellemc_powerstore_hostgroup (1.3.0) — module
Install with ansible-galaxy collection install dellemc.powerstore:==1.3.0
collections: - name: dellemc.powerstore version: 1.3.0
Managing host group on PowerStore storage system includes create host group with a set of hosts, add/remove hosts from host group, rename host group, and delete host group. Deletion of a host group results in deletion of the containing hosts as well. Remove hosts from the host group first to retain them.
- name: Create host group with hosts using host name dellemc_powerstore_hostgroup: array_ip: "{{array_ip}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" hostgroup_name: "{{hostgroup_name}}" hosts: - host1 - host2 state: 'present' host_state: 'present-in-group'
- name: Create host group with hosts using host ID dellemc_powerstore_hostgroup: array_ip: "{{array_ip}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" hostgroup_name: "{{hostgroup_name}}" hosts: - c17fc987-bf82-480c-af31-9307b89923c3 state: 'present' host_state: 'present-in-group'
- name: Get host group details dellemc_powerstore_hostgroup: array_ip: "{{array_ip}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" hostgroup_name: "{{hostgroup_name}}" state: 'present'
- name: Get host group details using ID dellemc_powerstore_hostgroup: array_ip: "{{array_ip}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" hostgroup_id: "{{host group_id}}" state: 'present'
- name: Add hosts to host group dellemc_powerstore_hostgroup: array_ip: "{{array_ip}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" hostgroup_name: "{{hostgroup_name}}" hosts: - host3 host_state: 'present-in-group' state: 'present'
- name: Remove hosts from host group dellemc_powerstore_hostgroup: array_ip: "{{array_ip}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" hostgroup_name: "{{hostgroup_name}}" hosts: - host3 host_state: 'absent-in-group' state: 'present'
- name: Rename host group dellemc_powerstore_hostgroup: array_ip: "{{array_ip}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" hostgroup_name: "{{hostgroup_name}}" new_name: "{{new_hostgroup_name}}" state: 'present'
- name: Delete host group dellemc_powerstore_hostgroup: array_ip: "{{array_ip}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" hostgroup_name: "{{hostgroup_name}}" state: 'absent'
user: description: - The username of the PowerStore host. required: true type: str hosts: description: - List of hosts to be added or removed from the host group. - Subordinate hosts in a host group can only be of one type, either FC or iSCSI. - Required when creating a host group. - To represent host, both name or ID can be used interchangeably. The module will detect both. elements: str type: list state: choices: - absent - present description: - Define whether the host group should exist or not. - present - indicates that the host group should exist on the system. - absent - indicates that the host group should not exist on the system. - Deletion of a host group results in deletion of the containing hosts as well. Remove hosts from the host group first to retain them. required: true type: str array_ip: description: - IP or FQDN of the PowerStore management system. required: true type: str new_name: description: - The new name for host group renaming function. This value must contain 128 or fewer printable Unicode characters. type: str password: description: - The password of the PowerStore host. required: true type: str host_state: choices: - present-in-group - absent-in-group description: - Define whether the hosts should be present or absent in host group. - present-in-group - indicates that the hosts should exist on the host group. - absent-in-group - indicates that the hosts should not exist on the host group. - Required when creating a host group with hosts or adding/removing hosts from existing host group. type: str verifycert: choices: - true - false description: - Boolean variable to specify whether to validate SSL certificate or not. - True - indicates that the SSL certificate should be verified. Set the environment variable REQUESTS_CA_BUNDLE to the path of the SSL certificate. - False - indicates that the SSL certificate should not be verified. required: true type: bool hostgroup_id: description: - The 36-character long host group id, automatically generated when a host group is created. - Use either hostgroup_id or hostgroup_name for modify and delete tasks. - hostgroup_id cannot be used while creating host group, as it is generated by the array after creation of host group. type: str hostgroup_name: description: - The host group name. This value must contain 128 or fewer printable Unicode characters. - Creation of an empty host group is not allowed. - Required when creating a host group. - Use either hostgroup_id or hostgroup_name for modify and delete tasks. type: str
changed: description: Whether or not the resource has changed. returned: always type: bool hostgroup_details: contains: description: description: Description about the host group. type: str hosts: contains: id: description: The ID of the host. type: str name: description: The name of the host. type: str description: The hosts details which are part of this host group. type: complex id: description: The system generated ID given to the host group. type: str name: description: Name of the host group. type: str description: Details of the host group. returned: When host group exists type: complex