morpheus.core.instance_snapshot (0.5.1) — module

Manage Instance Snapshots

| "added in version" 0.5.0 of morpheus.core"

Authors: James Riach

Install collection

Install with ansible-galaxy collection install morpheus.core:==0.5.1


Add to requirements.yml

  collections:
    - name: morpheus.core
      version: 0.5.1

Description

Manage Snapshots of Morpheus Instances.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove All Snapshots for Specific Instance
  morpheus.core.instance_snapshot:
    id: 200
    state: remove_all
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Revert Instance to Oldest Snapshot matching Name
  morpheus.core.instance_snapshot:
    name: WebServer001
    snapshot_name: Ansible Snapshot
    snapshot_age: oldest
    state: revert
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove Specific Snapshot by Id
  morpheus.core.instance_snapshot:
    snapshot_id: 50
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
id:
    description:
    - Specify the id of an instance.
    type: int

name:
    description:
    - Filter instances by name.
    type: string

state:
    choices:
    - absent
    - present
    - revert
    - remove_all
    default: present
    description:
    - Manage snapshot state of the specified instance(s)
    type: string

match_name:
    choices:
    - none
    - first
    - last
    - all
    default: none
    description:
    - Define instance selection method when specifying I(name) should more than one instance
      match.
    type: string

regex_name:
    default: false
    description:
    - Treat the name parameter as a regular expression.
    type: bool

snapshot_id:
    description:
    - Specify snapshot by id when using I(state=absent) or I(state=revert).
    type: int

snapshot_age:
    choices:
    - latest
    - oldest
    default: latest
    description:
    - Specify the age of the snapshot to match.
    type: string

snapshot_name:
    description:
    - Specify snapshot name.
    - Can be used with I(state=present), I(state=absent), I(state=revert).
    type: string

snapshot_description:
    description:
    - Specify description for snapshot.
    - Used with I(state=present)
    type: string

Outputs

snapshot_results:
  description:
  - List of results of each action performed against each instance and/or snapshot.
  returned: always
  sample:
    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