Backup Unit

backupunit

This is a simple module that supports creating or removing Backup Units. This module has a dependency on ionoscloud >= 6.0.2

Example Syntax


name: Create backupunit
ionoscloudsdk.ionoscloud.backupunit:
  backupunit_email: 'ansible.test@mail.com'
  backupunit_password: '{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_letters,digits') }}'
  name: My AnsibleAutoTestBackup
register: create_result


name: Recreate backupunit
ionoscloudsdk.ionoscloud.backupunit:
  backupunit: My AnsibleAutoTestBackup
  backupunit_email: 'updated.ansible.test@mail.com'
  backupunit_password: '{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_letters,digits') }}'
  name: My AnsibleAutoTestBackup UPDATED
  allow_replace: true
  state: update
register: recreate_result


name: Remove backupunit
ionoscloudsdk.ionoscloud.backupunit:
  backupunit: My AnsibleAutoTestBackup UPDATED
  state: absent
  wait: true
register: delete_result

Returned object

{
    "changed": true,
    "failed": false,
    "action": "update",
    "backupunit": {
        "href": "https://api.ionos.com/cloudapi/v6/backupunits/a23da1a9-33d9-4e39-b111-42e35f20833d",
        "id": "a23da1a9-33d9-4e39-b111-42e35f20833d",
        "metadata": {
            "created_by": "<USER_EMAIL>",
            "created_by_user_id": "<USER_ID>",
            "created_date": "2023-03-10T14:16:47+00:00",
            "etag": "210a96f62538bed984fd21654ba0f713",
            "last_modified_by": "<USER_EMAIL>",
            "last_modified_by_user_id": "<USER_ID>",
            "last_modified_date": "2023-05-31T11:28:27+00:00",
            "state": "BUSY"
        },
        "properties": {
            "email": "<EMAIL>",
            "name": "My AnsibleAutoTestBackup",
            "password": null
        },
        "type": "backupunit"
    }
}

For more examples please check out the tests here.

NOTE: If you are using a versions 7.0.0 and up: modules can replace resources if certain set parameters differ from the results found in the API!

Parameters that can trigger a resource replacement:

  • name

  • backupunit_email

  • backupunit_password (Will trigger replace just by being set as this parameter cannot be retrieved from the api to check for changes!)

state: present

  
name: Create backupunit
ionoscloudsdk.ionoscloud.backupunit:
  backupunit_email: 'ansible.test@mail.com'
  backupunit_password: '{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_letters,digits') }}'
  name: My AnsibleAutoTestBackup
register: create_result

Available parameters for state present:

NameRequiredDescription

name str

True

The name of the resource (alphanumeric characters only).

backupunit_password str

False

The password associated with that resource.

backupunit_email str

True

The email associated with the backup unit. Bear in mind that this email does not be the same email as of the user.

allow_replace bool

False

Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead Default: False

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

state: absent

  
name: Remove backupunit
ionoscloudsdk.ionoscloud.backupunit:
  backupunit: My AnsibleAutoTestBackup UPDATED
  state: absent
  wait: true
register: delete_result

Available parameters for state absent:

NameRequiredDescription

backupunit str

True

The ID or name of the virtual Backup Unit.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

state: update

  
name: Recreate backupunit
ionoscloudsdk.ionoscloud.backupunit:
  backupunit: My AnsibleAutoTestBackup
  backupunit_email: 'updated.ansible.test@mail.com'
  backupunit_password: '{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_letters,digits') }}'
  name: My AnsibleAutoTestBackup UPDATED
  allow_replace: true
  state: update
register: recreate_result

Available parameters for state update:

NameRequiredDescription

backupunit str

True

The ID or name of the virtual Backup Unit.

allow_replace bool

False

Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead Default: False

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

Last updated