theforeman.foreman.snapshot (4.0.0) — module

Manage Snapshots

| "added in version" 1.0.0 of theforeman.foreman"

Authors: Manisha Singhal (@Manisha15) ATIX AG

Install collection

Install with ansible-galaxy collection install theforeman.foreman:==4.0.0


Add to requirements.yml

  collections:
    - name: theforeman.foreman
      version: 4.0.0

Description

Manage Snapshots for Host Entities

This module can create, update, revert and delete snapshots

This module requires the foreman_snapshot_management plugin set up in the server

See: U(https://github.com/ATIX-AG/foreman_snapshot_management)


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Create a Snapshot"
  theforeman.foreman.snapshot:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "snapshot_before_software_upgrade"
    host: "server.example.com"
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Create Snapshots with same name"
  theforeman.foreman.snapshot:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "snapshot_before_software_upgrade"
    host: "server.example.com"
    state: new_snapshot
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Update a Snapshot"
  theforeman.foreman.snapshot:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "snapshot_before_software_upgrade"
    host: "server.example.com"
    description: "description of snapshot"
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Update a Snapshot with same name"
  theforeman.foreman.snapshot:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "snapshot_before_software_upgrade"
    host: "server.example.com"
    description: "description of snapshot"
    state: present
    id: "snapshot-id"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Revert a Snapshot"
  theforeman.foreman.snapshot:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "snapshot_before_software_upgrade"
    host: "server.example.com"
    state: reverted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Delete a Snapshot"
  theforeman.foreman.snapshot:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "snapshot_before_software_upgrade"
    host: "server.example.com"
    state: absent

Inputs

    
id:
    description:
    - Id of Snapshot
    required: false
    type: str

host:
    description:
    - Name of related Host
    required: true
    type: str

name:
    description:
    - Name of Snapshot
    required: true
    type: str

state:
    choices:
    - present
    - reverted
    - absent
    - new_snapshot
    default: present
    description:
    - State of Snapshot
    type: str

password:
    description:
    - Password of the user accessing the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_PASSWORD)
      will be used instead.
    required: true
    type: str

username:
    description:
    - Username accessing the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_USERNAME)
      will be used instead.
    required: true
    type: str

server_url:
    description:
    - URL of the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_SERVER_URL)
      will be used instead.
    required: true
    type: str

description:
    description:
    - Description of Snapshot
    required: false
    type: str

include_ram:
    description:
    - Option to add RAM (only available for VMWare compute-resource)
    required: false
    type: bool

validate_certs:
    default: true
    description:
    - Whether or not to verify the TLS certificates of the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_VALIDATE_CERTS)
      will be used instead.
    type: bool

Outputs

entity:
  contains:
    snapshots:
      description: List of snapshots.
      elements: dict
      type: list
  description: Final state of the affected entities grouped by their type.
  returned: success
  type: dict