community.general.scaleway_database_backup (8.5.0) — module

Scaleway database backups management module

| "added in version" 1.2.0 of community.general"

Authors: Guillaume Rodriguez (@guillaume_ro_fr)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module manages database backups on Scaleway account U(https://developer.scaleway.com).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Create a backup
    community.general.scaleway_database_backup:
        name: 'my_backup'
        state: present
        region: 'fr-par'
        database_name: 'my-database'
        instance_id: '50968a80-2909-4e5c-b1af-a2e19860dddb'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Export a backup
    community.general.scaleway_database_backup:
        id: '6ef1125a-037e-494f-a911-6d9c49a51691'
        state: exported
        region: 'fr-par'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Restore a backup
    community.general.scaleway_database_backup:
        id: '6ef1125a-037e-494f-a911-6d9c49a51691'
        state: restored
        region: 'fr-par'
        database_name: 'my-new-database'
        instance_id: '50968a80-2909-4e5c-b1af-a2e19860dddb'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Remove a backup
    community.general.scaleway_database_backup:
        id: '6ef1125a-037e-494f-a911-6d9c49a51691'
        state: absent
        region: 'fr-par'

Inputs

    
id:
    description:
    - UUID used to identify the database backup.
    - Required for V(absent), V(exported) and V(restored) states.
    type: str

name:
    description:
    - Name used to identify the database backup.
    - Required for V(present) state.
    - Ignored when O(state=absent), O(state=exported) or O(state=restored).
    required: false
    type: str

wait:
    default: false
    description:
    - Wait for the instance to reach its desired state before returning.
    type: bool

state:
    choices:
    - present
    - absent
    - exported
    - restored
    default: present
    description:
    - Indicate desired state of the database backup.
    - V(present) creates a backup.
    - V(absent) deletes the backup.
    - V(exported) creates a download link for the backup.
    - V(restored) restores the backup to a new database.
    type: str

region:
    choices:
    - fr-par
    - nl-ams
    - pl-waw
    description:
    - Scaleway region to use (for example V(fr-par)).
    required: true
    type: str

api_url:
    aliases:
    - base_url
    default: https://api.scaleway.com
    description:
    - Scaleway API URL.
    type: str

api_token:
    aliases:
    - oauth_token
    description:
    - Scaleway OAuth token.
    required: true
    type: str

expires_at:
    description:
    - Expiration datetime of the database backup (ISO 8601 format).
    - Ignored when O(state=absent), O(state=exported) or O(state=restored).
    required: false
    type: str

api_timeout:
    aliases:
    - timeout
    default: 30
    description:
    - HTTP timeout to Scaleway API in seconds.
    type: int

instance_id:
    description:
    - UUID of the instance associated to the database backup.
    - Required for V(present) and V(restored) states.
    - Ignored when O(state=absent) or O(state=exported).
    required: false
    type: str

wait_timeout:
    default: 300
    description:
    - Time to wait for the backup to reach the expected state.
    required: false
    type: int

database_name:
    description:
    - Name used to identify the database.
    - Required for V(present) and V(restored) states.
    - Ignored when O(state=absent) or O(state=exported).
    required: false
    type: str

validate_certs:
    default: true
    description:
    - Validate SSL certs of the Scaleway API.
    type: bool

wait_sleep_time:
    default: 3
    description:
    - Time to wait before every attempt to check the state of the backup.
    required: false
    type: int

query_parameters:
    default: {}
    description:
    - List of parameters passed to the query string.
    type: dict

Outputs

metadata:
  description: Backup metadata.
  returned: when O(state=present), O(state=exported), or O(state=restored)
  sample:
    metadata:
      created_at: '2020-08-06T12:42:05.631049Z'
      database_name: my-database
      download_url: null
      download_url_expires_at: null
      expires_at: null
      id: a15297bd-0c4a-4b4f-8fbb-b36a35b7eb07
      instance_id: 617be32e-6497-4ed7-b4c7-0ee5a81edf49
      instance_name: my-instance
      name: backup_name
      region: fr-par
      size: 600000
      status: ready
      updated_at: '2020-08-06T12:42:10.581649Z'
  type: dict