morpheus.core.instance (0.5.1) — module

Basic Management of Morpheus Instances

| "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

This module provides basic management of Morpheus Instances, such as setting running state, backup, deletion and lock status.

Usage examples

1
  • Warning
    Parameter 'id' coerced from 'int' to 'str' in module 'morpheus.core.instance'. This may cause unexpected behaviour.
- name: Restart a specific instance
  morpheus.core.instance:
    id: 200
    state: restarted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Stop all instances matching regex name pattern
  morpheus.core.instance:
    name: ^PROD.*$
    regex_name: true
    match_name: all
    state: stopped
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Suspend the first instance that matches name
  morpheus.core.instance:
    name: PRODWEBSVR001
    match_name: first
    state: suspended
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove instance but keep backups
  morpheus.core.instance:
    name: PRODWEBSVR002
    match_name: first
    state: absent
    remove_options:
      keep_backups: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Backup all instances
  morpheus.core.instance:
    name: ^.*$
    regex_name: true
    match_name: all
    state: backup

Inputs

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

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

state:
    choices:
    - running
    - started
    - stopped
    - restarted
    - suspended
    - locked
    - unlocked
    - backup
    - absent
    - eject
    description:
    - Set the State of the Instance.
    - C(eject) - Ejects ISO media from the instance.
    required: true
    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

remove_options:
    description:
    - When I(state=absent) specify additional removal options.
    suboptions:
      force:
        default: false
        description:
        - Force removal of instance.
        type: bool
      keep_backups:
        default: false
        description:
        - Keep instances backups.
        type: bool
      preserve_volumes:
        default: false
        description:
        - Preserve the instances volumes.
        type: bool
      release_floating_ips:
        default: false
        description:
        - Release instances floating IP Addresses.
        type: bool
    type: dict

Outputs

instance_state:
  description:
  - State of the instance(s) following the requested action.
  returned: always
  sample:
    instance_state:
    - id: 200
      locked: true
      name: PRODWEBSVR001
      status: running