orphan: |
---|
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 |
---|---|
Specify the id of an instance. |
|
Define instance selection method when specifying :ansopt:`morpheus.core.instance#module:name` should more than one instance match. .. rst-class:: ansible-option-line |
|
Filter instances by name. |
|
Treat the name parameter as a regular expression. .. rst-class:: ansible-option-line |
|
When :ansopt:`morpheus.core.instance#module:state=absent` specify additional removal options. |
|
Force removal of instance. .. rst-class:: ansible-option-line |
|
Keep instances backups. .. rst-class:: ansible-option-line |
|
Preserve the instances volumes. .. rst-class:: ansible-option-line |
|
Release instances floating IP Addresses. .. rst-class:: ansible-option-line |
|
Set the State of the Instance. :ansval:`eject` - Ejects ISO media from the instance. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:`
|
.. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10}
Attribute | Support | Description |
---|---|---|
Can run in check_mode and return changed status prediction without modifying target |
||
Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode |
||
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 |
---|---|
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"}]}` |
- James Riach (@McGlovin1337)
.. ansible-links:: - title: "Repository (Sources)" url: "https://www.github.com/gomorpheus/ansible-collection-morpheus-core" external: true