Skip to content

Latest commit

 

History

History
2045 lines (1061 loc) · 44.3 KB

vcenter_cloud_module.rst

File metadata and controls

2045 lines (1061 loc) · 44.3 KB
orphan:

morpheus.core.vcenter_cloud module -- Manage a VMware VCenter Cloud

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.vcenter_cloud.

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

New in morpheus.core 0.7.0

  • Manage VMware VCenter Clouds.
.. tabularcolumns:: \X{1}{3}\X{2}{3}

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

account_id

.. ansible-option-type-line::

  :ansible-option-aliases:`aliases: tenant_id`

  :ansible-option-type:`integer`

Set the tenant for which Cloud is assigned to.

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

agent_mode

.. ansible-option-type-line::

  :ansible-option-type:`string`

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

api_url

.. ansible-option-type-line::

  :ansible-option-type:`string`

The VCenter API URL.

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

api_version

.. ansible-option-type-line::

  :ansible-option-type:`string`

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

appliance_url

.. ansible-option-type-line::

  :ansible-option-type:`string`

URL of the Morpheus Appliance.

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

auto_recover_power_state

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

Automatically Power-on Virtual Machines.

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

:ansible-option-choices:`Choices:`

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

cluster

.. ansible-option-type-line::

  :ansible-option-type:`string`

VCenter Cluster name.

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

code

.. ansible-option-type-line::

  :ansible-option-type:`string`

The code to reference the Cloud for use in polcies etc.

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

console_keymap

.. ansible-option-type-line::

  :ansible-option-aliases:`aliases: keyboard_layout`

  :ansible-option-type:`string`

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

costing_mode

.. ansible-option-type-line::

  :ansible-option-aliases:`aliases: costing`

  :ansible-option-type:`string`

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

credential_id

.. ansible-option-type-line::

  :ansible-option-type:`integer`

Specify id of existing credentials to use.

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

dark_logo

.. ansible-option-type-line::

  :ansible-option-type:`string`

Path to an image file to use as the Cloud logo when in dark mode.

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

datacenter

.. ansible-option-type-line::

  :ansible-option-type:`string`

VCenter Datacenter name.

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

datacenter_name

.. ansible-option-type-line::

  :ansible-option-type:`string`

Custom Datacenter Identifier.

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

description

.. ansible-option-type-line::

  :ansible-option-type:`string`

Set the description of the Cloud.

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

disk_storage_type

.. ansible-option-type-line::

  :ansible-option-type:`string`

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

enable_disk_type_selection

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

Enable user to select Virtual Machine Disk type.

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

:ansible-option-choices:`Choices:`

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

enable_network_type_selection

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

Enable user to select the Network Interface type.

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

:ansible-option-choices:`Choices:`

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

enable_storage_type_selection

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

Enable user to select the Storage type.

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

:ansible-option-choices:`Choices:`

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

enable_vnc

.. ansible-option-type-line::

  :ansible-option-aliases:`aliases: enable_console`

  :ansible-option-type:`boolean`

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

enabled

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

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

force_remove

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

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

group_id

.. ansible-option-type-line::

  :ansible-option-type:`integer`

Set the Cloud Group this Cloud is a member of.

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

guidance_mode

.. ansible-option-type-line::

  :ansible-option-aliases:`aliases: guidance`

  :ansible-option-type:`string`

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

hide_host_selection

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

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

id

.. ansible-option-type-line::

  :ansible-option-aliases:`aliases: cloud_id, zone_id`

  :ansible-option-type:`integer`

Specify an existing Cloud to Update or Remove.

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

import_existing

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

Inventory Cloud and Import existing Virtual Machines.

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

:ansible-option-choices:`Choices:`

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

location

.. ansible-option-type-line::

  :ansible-option-type:`string`

Add location information for the Cloud.

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

logo

.. ansible-option-type-line::

  :ansible-option-type:`string`

Path to an image file to use as the Cloud logo.

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

name

.. ansible-option-type-line::

  :ansible-option-type:`string`

Set the name of the Cloud.

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

password

.. ansible-option-type-line::

  :ansible-option-type:`string`

Specify a password to access the cloud.

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

refresh_mode

.. ansible-option-type-line::

  :ansible-option-type:`string`

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

refresh_period

.. ansible-option-type-line::

  :ansible-option-type:`integer`

The invoice billing period to refresh.

The value should be in the format of YYYYMM.

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

remove_resources

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

Relevant when :ansopt:`morpheus.core.vcenter\_cloud#module:state=absent`, remove associated resources when removing the cloud.

Includes removal of Virtual Machines and other forms of Compute.

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

:ansible-option-choices:`Choices:`

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

resource_pool

.. ansible-option-type-line::

  :ansible-option-type:`string`

VCenter Resource Pool name.

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

rpc_mode

.. ansible-option-type-line::

  :ansible-option-type:`string`

Cloud workload interaction method.

:ansval:`guestexec` = VMWare Tools

:ansval:`rpc` = SSH/WinRM

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

:ansible-option-choices:`Choices:`

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

scale_priority

.. ansible-option-type-line::

  :ansible-option-type:`integer`

Set Scale Priority.

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

security_mode

.. ansible-option-type-line::

  :ansible-option-type:`string`

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

state

.. ansible-option-type-line::

  :ansible-option-type:`string`

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

timezone

.. ansible-option-type-line::

  :ansible-option-type:`string`

The Time Zone of the Cloud.

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

username

.. ansible-option-type-line::

  :ansible-option-type:`string`

Specify a username to access the cloud.

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

visibility

.. ansible-option-type-line::

  :ansible-option-type:`string`

Toggle tenant visibility between Private or Public.

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

:ansible-option-choices:`Choices:`

.. 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 new VCenter Cloud
  morpheus.core.vcenter_cloud:
    state: present
    name: VCenter Cloud
    description: A VCenter Cloud
    code: 'vccloud'
    location: 'south'
    visibility: private
    group_id: 50
    account_id: 1
    enabled: true
    agent_mode: cloudinit
    auto_recover_power_state: false
    import_existing: false
    costing_mode: off
    guidance_mode: off
    security_mode: off
    credential_id: 3
    api_url: 'https://vcenter.domain.tld/sdk'
    api_version: '7.0'
    datacenter: 'VCCloud'
    cluster: 'Cluster01'
    resource_pool: 'All'
    rpc_mode: guestexec
    disk_storage_type: thin
    enable_disk_type_selection: true
    enable_storage_type_selection: false
    enable_network_type_selection: true
    enable_vnc: true
    hide_host_selection: true
    console_keymap: uk
    timezone: "Europe/London"

- name: Remove VCenter Cloud
  morpheus.core.vcenter_cloud:
    state: absent
    id: 56
    force_remove: true

- name: Refresh and Rebuild Cloud Costing
  morpheus.core.vcenter_cloud:
    state: refresh
    name: VCenter Cloud
    refresh_mode: costing_rebuild

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

cloud

.. ansible-option-type-line::

  :ansible-option-type:`dictionary`

Information related to the specified cloud.

.. 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:`{"cloud": {"account": {"id": 1, "name": "MasterTenant"}, "account\_id": 1, "agent\_mode": "cloudinit", "api\_proxy": null, "auto\_recover\_power\_state": false, "code": "vccloud", "config": {"api\_url": "https://vcenter.domain.tld/sdk", "api\_version": "7.0", "appliance\_url": null, "cluster": "Cluster01", "config\_cmdb\_discovery": false, "datacenter": "VCCloud", "datacenter\_name": null, "disk\_storage\_type": "thin", "enable\_disk\_type\_selection": true, "enable\_network\_type\_selection": true, "enable\_storage\_type\_selection": false, "enable\_vnc": true, "hide\_host\_selection": true, "import\_existing": false, "resource\_pool": "All", "rpc\_mode": "guestexec"}, "console\_keymap": "uk", "container\_mode": "docker", "cost\_last\_sync": null, "cost\_last\_sync\_duration": null, "cost\_status": "ok", "cost\_status\_date": null, "cost\_status\_message": null, "costing\_mode": "off", "credential": {"id": 3, "name": "VCenter Creds", "type": "username-password"}, "dark\_image\_path": null, "date\_created": "2024-01-01T00:00:01Z", "domain\_name": "localdomain", "enabled": false, "external\_id": null, "groups": [{"account\_id": 1, "id": 50, "name": "VCGroup"}], "guidance\_mode": "manual", "id": 56, "image\_path": null, "inventory\_level": "off", "last\_sync": null, "last\_sync\_duration": null, "last\_updated": "2024-01-01T00:00:01Z", "location": "south", "name": "VCenter Cloud", "network\_domain": null, "network\_server": null, "next\_run\_date": null, "owner": {"id": 1, "name": "MasterTenant"}, "provisioning\_proxy": null, "region\_code": null, "scale\_priority": 1, "security\_mode": "off", "security\_server": null, "server\_count": 0, "service\_version": null, "stats": {"server\_counts": {"all": 0, "baremetal": 0, "container\_host": 0, "host": 0, "hypervisor": 0, "unmanaged": 0, "vm": 0}}, "status": "initializing", "status\_date": null, "status\_message": null, "storage\_mode": "standard", "timezone": "Europe/London", "user\_data\_linux": null, "user\_data\_windows": null, "visibility": "private", "zone\_type": {"code": "vmware", "id": 28, "name": "VMware vCenter"}, "zone\_type\_id": 28}}`

Authors

  • James Riach (@McGlovin1337)

Collection links

.. ansible-links::

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