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_snapshot
.
.. rst-class:: ansible-version-added
New in morpheus.core 0.5.0
- Manage Snapshots of Morpheus Instances.
.. 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\_snapshot#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 |
|
Specify the age of the snapshot to match. .. rst-class:: ansible-option-line |
|
Specify description for snapshot. Used with :ansopt:`morpheus.core.instance\_snapshot#module:state=present` |
|
Specify snapshot by id when using :ansopt:`morpheus.core.instance\_snapshot#module:state=absent` or :ansopt:`morpheus.core.instance\_snapshot#module:state=revert`. |
|
Manage snapshot state of the specified instance(s) .. rst-class:: ansible-option-line |
.. 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: Snapshot All Instances
morpheus.core.instance_snapshot:
name: ^.*$
match_name: all
regex_name: true
snapshot_name: Ansible Snapshot
snapshot_description: Snapshot Created via Ansible
state: present
- name: Remove All Snapshots for Specific Instance
morpheus.core.instance_snapshot:
id: 200
state: remove_all
- name: Revert Instance to Oldest Snapshot matching Name
morpheus.core.instance_snapshot:
name: WebServer001
snapshot_name: Ansible Snapshot
snapshot_age: oldest
state: revert
- name: Remove Specific Snapshot by Id
morpheus.core.instance_snapshot:
snapshot_id: 50
state: absent
- name: Remove the Latest Snapshot matching Name for all Instances
morpheus.core.instance_snapshot:
name: ^.*$
match_name: all
regex_name: true
snapshot_name: Ansible Snapshot
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 |
---|---|
List of results of each action performed against each instance and/or snapshot. .. 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:`{"snapshot\_results": [{"action": "create", "instance\_id": 1, "instance\_name": "WebServer001", "msg": "", "snapshot\_date": null, "snapshot\_description": "Snapshot Created via Ansible", "snapshot\_id": null, "snapshot\_name": "Ansible Snapshot", "success": true}]}` |
- James Riach (@McGlovin1337)
.. ansible-links:: - title: "Repository (Sources)" url: "https://www.github.com/gomorpheus/ansible-collection-morpheus-core" external: true