nttmcp.mcp.snapshot_script (1.0.9) — module

Enable/Disable and Update the Snapshot Service on a server

| "added in version" 2.10.0 of nttmcp.mcp"

Authors: Ken Sinfield (@kensinfield)

preview | supported by NTT Ltd.

Install collection

Install with ansible-galaxy collection install nttmcp.mcp:==1.0.9


Add to requirements.yml

  collections:
    - name: nttmcp.mcp
      version: 1.0.9

Description

Enable/Disable and Update the Snapshot Service on a server


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- hosts: 127.0.0.1
  connection: local
  collections:
    - nttmcp.mcp
  tasks:

  - name: Configure Pre and Post snapshot scripts for a server
    snapshot_script:
      region: na
      datacenter: NA9
      network_domain: my_network_domain
      server: My_Server
      pre_path: /usr/local/bin/my_pre_script
      pre_description: A pre script
      post_path: /usr/local/bin/my_post_script
      post_description: A post script
      username: myuser
      password: mypassword

  - name: Remove the Pre script from a server
    snapshot_script:
      region: na
      datacenter: NA9
      network_domain: my_network_domain
      server: My_Server
      pre_path: /usr/local/bin/my_pre_script
      state: absent

  - name: Remove all scripts from a server
    snapshot_script:
      region: na
      datacenter: NA9
      network_domain: my_network_domain
      server: My_Server
      pre_path: /usr/local/bin/my_pre_script
      post_path: /usr/local/bin/my_post_script
      state: absent

Inputs

    
auth:
    description:
    - Optional dictionary containing the authentication and API information for Cloud
      Control
    required: false
    suboptions:
      api:
        description:
        - The Cloud Control API endpoint e.g. api-na.mcp-services.net
        required: false
        type: str
      api_version:
        description:
        - The Cloud Control API version e.g. 2.11
        required: false
        type: str
      password:
        description:
        - The Cloud Control API user password
        required: false
        type: str
      username:
        description:
        - The Cloud Control API username
        required: false
        type: str
    type: dict

state:
    choices:
    - present
    - absent
    default: present
    description:
    - The action to be performed
    required: false
    type: str

region:
    default: na
    description:
    - The geographical region
    required: false
    type: str

server:
    description:
    - The name of a server to enable Snapshots on
    required: true
    type: str

password:
    description:
    - The password of the OS level user
    required: false
    type: str

pre_path:
    description:
    - The full path to a script on the VM that will be run before a snapshot is taken
    required: false
    type: str

username:
    description:
    - The username of an OS level user with sufficient permissions to execute the scripts
    - It is strongly advised not to use root/administrator but a dedicated snapshot script
      user with
    - only those permissions required to execute the scripts
    required: false
    type: str

post_path:
    description:
    - The full path to a script on the VM that will be run after a snapshot has been taken
    required: false
    type: str

datacenter:
    description:
    - The datacenter name
    required: true
    type: str

on_failure:
    choices:
    - CONTINUE
    - ABORT
    default: CONTINUE
    description:
    - What to do in the event of a sript failure
    required: false
    type: str

pre_timeout:
    default: 300
    description:
    - The timeout (in seconds) to apply to the pre-script in case of issues
    required: false
    type: int

network_domain:
    description:
    - The name of a Cloud Network Domain
    required: true
    type: str

pre_description:
    description:
    - The description for the pre-script
    required: false
    type: str

post_description:
    description:
    - The description for the post-script
    required: false
    type: str

Outputs

msg:
  description: Status of the operation
  returned: always
  sample: Server snapshot script(s) have been deleted
  type: str