Skip to content

Latest commit

 

History

History
810 lines (422 loc) · 16.6 KB

instance_module.rst

File metadata and controls

810 lines (422 loc) · 16.6 KB
orphan:

morpheus.core.instance module -- Basic Management of Morpheus Instances

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

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

New in morpheus.core 0.5.0

  • This module provides basic management of Morpheus Instances, such as setting running state, backup, deletion and lock status.
.. tabularcolumns:: \X{1}{3}\X{2}{3}

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

id

.. ansible-option-type-line::

  :ansible-option-type:`integer`

Specify the id of an instance.

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

match_name

.. ansible-option-type-line::

  :ansible-option-type:`string`

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

name

.. ansible-option-type-line::

  :ansible-option-type:`string`

Filter instances by name.

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

regex_name

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

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

remove_options

.. ansible-option-type-line::

  :ansible-option-type:`dictionary`

When :ansopt:`morpheus.core.instance#module:state=absent` specify additional removal options.

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

force

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

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

keep_backups

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

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

preserve_volumes

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

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

release_floating_ips

.. ansible-option-type-line::

  :ansible-option-type:`boolean`

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

state

.. ansible-option-type-line::

  :ansible-option-type:`string` / :ansible-option-required:`required`

.. 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: Restart a specific instance
  morpheus.core.instance:
    id: 200
    state: restarted

- name: Stop all instances matching regex name pattern
  morpheus.core.instance:
    name: ^PROD.*$
    regex_name: true
    match_name: all
    state: stopped

- name: Suspend the first instance that matches name
  morpheus.core.instance:
    name: PRODWEBSVR001
    match_name: first
    state: suspended

- name: Remove instance but keep backups
  morpheus.core.instance:
    name: PRODWEBSVR002
    match_name: first
    state: absent
    remove_options:
      keep_backups: true

- name: Backup all instances
  morpheus.core.instance:
    name: ^.*$
    regex_name: true
    match_name: all
    state: backup

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

instance_state

.. ansible-option-type-line::

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

State of the instance(s) following the requested action.

.. 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:`{"instance\_state": [{"id": 200, "locked": true, "name": "PRODWEBSVR001", "status": "running"}]}`

Authors

  • James Riach (@McGlovin1337)

Collection links

.. ansible-links::

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