Skip to content

Latest commit

 

History

History
1547 lines (786 loc) · 32.1 KB

virtual_image_module.rst

File metadata and controls

1547 lines (786 loc) · 32.1 KB
orphan:

morpheus.core.virtual_image module -- Manage Morpheus Virtual Images

Note

This module is part of the morpheus.core collection (version 0.7.1).

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 morpheus.core.

To use it in a playbook, specify: morpheus.core.virtual_image.

.. rst-class:: ansible-version-added

New in morpheus.core 0.6.0

  • Manage Morpheus Virtual Images.
.. tabularcolumns:: \X{1}{3}\X{2}{3}

Parameter Comments
.. rst-class:: ansible-option-title

accounts

.. ansible-option-type-line::

  :ansible-option-type:`list` / :ansible-option-elements:`elements=integer`

List of Tenants by Id Virtual Image is available to.

.. rst-class:: ansible-option-title

azure_config

.. ansible-option-type-line::

  :ansible-option-type:`dictionary`

For Azure Virtual Images, specify further options.

.. rst-class:: ansible-option-title

offer

.. ansible-option-type-line::

  :ansible-option-type:`string`

Name of Offer in the Azure Marketplace.

.. rst-class:: ansible-option-title

publisher

.. ansible-option-type-line::

  :ansible-option-type:`string`

Name of Publisher in the Azure Marketplace.

.. rst-class:: ansible-option-title

sku

.. ansible-option-type-line::

  :ansible-option-type:`string`

Name of SKU in the Azure Marketplace.

.. rst-class:: ansible-option-title

version

.. ansible-option-type-line::

  :ansible-option-type:`string`

Name of Version in the Azure Marketplace.

.. rst-class:: ansible-option-title

config

.. ansible-option-type-line::

  :ansible-option-type:`dictionary`

Dictionary of Virtual Image configuration.

.. rst-class:: ansible-option-title

file_url

.. ansible-option-type-line::

  :ansible-option-type:`string`

URL of file to upload.

.. rst-class:: ansible-option-title

filename

.. ansible-option-type-line::

  :ansible-option-type:`string`

Name of uploaded file.

.. rst-class:: ansible-option-title

image_type

.. ansible-option-type-line::

  :ansible-option-type:`string`

Set the Image Type code, e.g. vmware

.. rst-class:: ansible-option-title

install_agent

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

Specify if Morpheus Agent should be installed.

.. rst-class:: ansible-option-line

:ansible-option-choices:`Choices:`

.. rst-class:: ansible-option-title

is_auto_join_domain

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

.. rst-class:: ansible-option-title

is_cloud_init

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

Specify if Cloud Init is enabled.

.. rst-class:: ansible-option-line

:ansible-option-choices:`Choices:`

.. rst-class:: ansible-option-title

is_sysprep

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

.. rst-class:: ansible-option-title

labels

.. ansible-option-type-line::

  :ansible-option-type:`list` / :ansible-option-elements:`elements=string`

Provide a list of labels to apply to Virtual Image.

.. rst-class:: ansible-option-title

name

.. ansible-option-type-line::

  :ansible-option-type:`string`

Set the Name of the Virtual Image

.. rst-class:: ansible-option-title

os_type

.. ansible-option-type-line::

  :ansible-option-type:`string`

Specify the OS Type code or name.

.. rst-class:: ansible-option-title

password

.. ansible-option-type-line::

  :ansible-option-type:`string`

Specify the Password for the Virtual Image.

.. rst-class:: ansible-option-title

ssh_key

.. ansible-option-type-line::

  :ansible-option-type:`string`

Specify an SSH Key for the Virtual Image.

.. rst-class:: ansible-option-title

state

.. ansible-option-type-line::

  :ansible-option-type:`string`

.. rst-class:: ansible-option-title

storage_provider_id

.. ansible-option-type-line::

  :ansible-option-type:`integer`

Specify the Storage Provider by Id.

.. rst-class:: ansible-option-title

tags

.. ansible-option-type-line::

  :ansible-option-type:`list` / :ansible-option-elements:`elements=dictionary`

List of Tags to apply.

.. rst-class:: ansible-option-title

name

.. ansible-option-type-line::

  :ansible-option-type:`string`

The Tag name.

.. rst-class:: ansible-option-title

value

.. ansible-option-type-line::

  :ansible-option-type:`string`

The Tag value.

.. rst-class:: ansible-option-title

trial_version

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

Is the Virtual Image a Trial Version.

.. rst-class:: ansible-option-line

:ansible-option-choices:`Choices:`

.. rst-class:: ansible-option-title

user_data

.. ansible-option-type-line::

  :ansible-option-type:`string`

Cloud Init user data.

.. rst-class:: ansible-option-title

username

.. ansible-option-type-line::

  :ansible-option-type:`string`

Specify the Username for the Virtual Image.

.. rst-class:: ansible-option-title

virtio_supported

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

.. rst-class:: ansible-option-title

virtual_image_id

.. ansible-option-type-line::

  :ansible-option-type:`integer`

Specify Virtual Image by Id.

.. rst-class:: ansible-option-title

visibility

.. ansible-option-type-line::

  :ansible-option-type:`string`

If the Virtual Image should be private or public.

.. rst-class:: ansible-option-line

:ansible-option-choices:`Choices:`

.. rst-class:: ansible-option-title

vm_tools_installed

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

.. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10}

Attribute Support Description
.. rst-class:: ansible-option-title

check_mode

Can run in check_mode and return changed status prediction without modifying target

.. rst-class:: ansible-option-title

diff_mode

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode

.. rst-class:: ansible-option-title

platform

Target OS/families that can be operated against

- name: Create Virtual Image and upload File
  morpheus.core.virtual_image:
    state: present
    name: My VMware Image
    image_type: vmware
    is_cloud_init: true
    install_agent: true
    username: root
    password: Password123
    os_type: redhat 8 64bit
    visibility: public
    accounts:
        - 1
    vm_tools_installed: true
    filename: rhel8x64.ova
    file_url: https://my.domain.tld/rhel8x64.ova

- name: Remove Virtual Image by Name
  morpheus.core.virtual_image:
    state: absent
    name: Win2016

- name: Remove Virtual Image by Id
  morpheus.core.virtual_image:
    state: absent
    virtual_image_id: 700

- name: Remove Virtual Image File
  morpheus.core.virtual_image:
    virtual_image_id: 750
    filename: windows_template.ova
    state: absent

Common return values are documented :ref:`here <common_return_values>`, the following are the fields unique to this module:

.. tabularcolumns:: \X{1}{3}\X{2}{3}

Key Description
.. rst-class:: ansible-option-title

virtual_image

.. ansible-option-type-line::

  :ansible-option-type:`dictionary`

Information about the Virtual Image.

.. rst-class:: ansible-option-line

:ansible-option-returned-bold:`Returned:` always

.. rst-class:: ansible-option-line
.. rst-class:: ansible-option-sample

:ansible-option-sample-bold:`Sample:` :ansible-rv-sample-value:`{"virtual\_image": {"accounts": [{"id": 1, "name": "TenantA"}], "config": {"disk\_ids": []}, "console\_keymap": null, "date\_created": "2023-10-06T23:15:39Z", "description": null, "external\_id": null, "fips\_enabled": false, "guest\_console\_password": null, "guest\_console\_password\_hash": null, "guest\_console\_port": null, "guest\_console\_type": null, "guest\_console\_username": null, "id": 700, "image\_type": "vmware", "install\_agent": true, "is\_auto\_join\_domain": false, "is\_cloud\_init": false, "is\_force\_customization": false, "is\_sysprep": true, "labels": [], "last\_updated": "2023-10-08T21:15:26Z", "linked\_clone": false, "locations": [], "min\_disk": null, "min\_disk\_gb": null, "min\_ram": null, "min\_ram\_gb": null, "name": "Windows 2022 Template", "network\_interfaces": [], "os\_type": {"bit\_count": 64, "category": "windows", "code": "windows.server.2022", "description": null, "id": 27, "name": "windows server 2022", "os\_family": "windows", "os\_version": "2022", "platform": "windows", "vendor": "microsoft"}, "owner\_id": 1, "raw\_size": null, "raw\_size\_gb": null, "ssh\_key": null, "ssh\_password": "\*\*\*\*\*\*\*\*\*\*\*\*", "ssh\_password\_hash": "936a185caaa266bb9cbe981e9e05cb78cd732b0b3280eb944412bb6f8f8f07af", "ssh\_username": "Administrator", "status": "Active", "storage\_controllers": [], "storage\_provider": null, "system\_image": false, "tags": [{"id": 150, "name": "Bleh", "value": "Blah"}, {"id": 149, "name": "Foo", "value": "Bar"}], "tenant": {"id": 1, "name": "TenantA"}, "trial\_version": false, "uefi": false, "user\_data": null, "user\_defined": false, "user\_uploaded": true, "virtio\_supported": false, "visibility": "public", "vm\_tools\_installed": true, "volumes": []}}`

Authors

  • James Riach (@McGlovin1337)

Collection links

.. ansible-links::

  - title: "Repository (Sources)"
    url: "https://www.github.com/gomorpheus/ansible-collection-morpheus-core"
    external: true