scale_computing.hypercore.iso module – Manage ISO images on HyperCore API

Note

This module is part of the scale_computing.hypercore collection (version 1.6.0).

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 scale_computing.hypercore.

To use it in a playbook, specify: scale_computing.hypercore.iso.

New in scale_computing.hypercore 1.0.0

Synopsis

  • Use this module to upload a new ISO image from ansible controller to HyperCore or delete existing ISO images from HyperCore API.

  • An ISO image can be uploaded from a shared (SMB) storage or from an HTTP link by downloading it first to the ansible controller’s local disk.

Parameters

Parameter

Comments

cluster_instance

dictionary

Scale Computing HyperCore instance information.

auth_method

string

Select login method. If not set, the value of the SC_AUTH_METHOD environment variable will be used.

Value local - username/password is verified by the HyperCore server (the local users).

Value oidc - username/password is verified by the configured OIDC provider.

Choices:

  • "local" ← (default)

  • "oidc"

host

string / required

The HyperCore instance URL.

If not set, the value of the SC_HOST environment variable will be used.

For example “https://10.1.2.3:443”.

password

string / required

Password used for authentication.

If not set, the value of the SC_PASSWORD environment variable will be used.

timeout

float

Timeout in seconds for the connection with the Scale Computing HyperCore API instance.

If not set, the value of the SC_TIMEOUT environment variable will be used.

username

string / required

Username used for authentication.

If not set, the value of the SC_USERNAME environment variable will be used.

name

string / required

ISO image’s name.

If ISO object with such name already exists on HyperCore API, no action will be performed.

Otherwise, ISO object with such name will be created and iso image from the source uploaded.

source

string

Only relevant if you want to post an iso image to the HyperCore API (setting state=present).

path to ISO image on ansible controller.

It must not be http or smb link

state

string / required

The desired state of iso object.

If state=present, the module uploads new ISO image from ansible controller.

If state=absent, the module deletes an existing ISO image from HyperCore API.

Choices:

  • "present"

  • "absent"

Notes

Note

  • check_mode is not supported.

  • Return value record is added in version 1.2.0, and deprecates return value results. Return value results will be removed in future release. List of deprecation changes includes examples to help with transition.

See Also

See also

scale_computing.hypercore.iso_info

Retrieve ISO images.

Examples

- name: Create ISO image
  scale_computing.hypercore.iso:
    name: CentOS-Stream-9-latest-x86_64-dvd1.iso
    source: /path/to/my.iso  # filename on ansible controller, never http/smb link
    state: present

- name: Remove ISO image
  scale_computing.hypercore.iso:
    name: CentOS-Stream-9-latest-x86_64-dvd1.iso
    state: absent

Return Values

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

Key

Description

record

dictionary

Updated ISO object from HyperCore API.

Returned: success

mounts

list / elements=dictionary

VMs this image is attached to

Returned: success

Sample: {"vm_name": "xlab", "vm_uuid": "51e6d073-7566-4273-9196-58720117bd7f"}

name

string

Filename of the image, must end in “.iso”

Returned: success

Sample: "SW_DVD9_Win_Server_STD_CORE_2022_2108.11_64Bit_English_DC_STD_MLF_X23-17134.ISO"

path

string

Storage device used in conjunction with VirDomainBlockDevice.path

Returned: success

Sample: "scribe/171afce9-2452-4294-9bc4-6e8ae49f7e4c"

ready_for_insert

boolean

The flag indicates the ISO image content is fully uploaded, and image is ready to be used.

Flag is `false` only for images that are in middle of upload, or where upload was terminated in middle.

Returned: success

Sample: true

size

integer

Size of the ISO file, in bytes

Returned: success

Sample: 5110759424

uuid

string

Unique identifier

Returned: success

Sample: "171afce9-2452-4294-9bc4-6e8ae49f7e4c"

results

list / elements=dictionary

List with one element - updated ISO object from HyperCore API.

This value is deprecated and will be removed in a future release. Please use record instead.

Returned: success

mounts

list / elements=dictionary

VMs this image is attached to

Returned: success

Sample: {"vm_name": "xlab", "vm_uuid": "51e6d073-7566-4273-9196-58720117bd7f"}

name

string

Filename of the image

Returned: success

Sample: "SW_DVD9_Win_Server_STD_CORE_2022_2108.11_64Bit_English_DC_STD_MLF_X23-17134.ISO"

path

string

Storage device used in conjunction with VirDomainBlockDevice.path

Returned: success

Sample: "scribe/171afce9-2452-4294-9bc4-6e8ae49f7e4c"

ready_for_insert

boolean

The flag indicates the ISO image content is fully uploaded, and image is ready to be used.

Flag is `false` only for images that are in middle of upload, or where upload was terminated in middle.

Returned: success

Sample: true

size

integer

Size of the ISO file, in bytes

Returned: success

Sample: 5110759424

uuid

string

Unique identifier

Returned: success

Sample: "171afce9-2452-4294-9bc4-6e8ae49f7e4c"

Authors

  • Tjaž Eržen (@tjazsch)