vmware.vmware.vcsa_backup_schedule module – Configure the vCenter Server Appliance backup schedule

Note

This module is part of the vmware.vmware collection (version 2.3.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install vmware.vmware.

To use it in a playbook, specify: vmware.vmware.vcsa_backup_schedule.

Synopsis

  • Configure the vCenter Server Appliance backup schedule.

  • Only one schedule per vCenter Server Appliance can exist.

  • Before taking a backup, a backup server must be set up and configured such that the vCenter server has access to it. The protocols supported for backup are FTPS, HTTPS, SFTP, FTP, NFS, SMB and HTTP.

Parameters

Parameter

Comments

always_update_password

boolean

If true and encryption_password or location.password is set, this module will always report a change and set the appropriate password values.

If false, other properties are still checked for differences. If a difference is found, the value of encryption_password and/or location.password is still used.

If the password options are unset, this parameter is ignored.

This option is needed because there is no way to check the current password value and compare it against the desired password value.

Choices:

  • false

  • true ← (default)

db_fast_backup

boolean

If true, the underlying Postgres DB/VCDB will use a fast backup method.

Choices:

  • false ← (default)

  • true

enabled

boolean

Whether or not the schedule should be enabled.

Choices:

  • false

  • true ← (default)

encryption_password

string

A password to use to encrypt the backup.

If this is unset, the backup is not encrypted.

hostname

string

The hostname or IP address of the vSphere vCenter server.

If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.

include_stats_events_and_tasks

boolean

If true, historical data about stats, events, and tasks will be included in the backups.

Choices:

  • false

  • true ← (default)

include_supervisors_control_plane

boolean

If true, the supervisors control plane will be included in the backups.

Choices:

  • false

  • true ← (default)

location

dictionary

Options describing the location where the backup should be stored.

password

string

The password to use to authenticate to the location URL, if one is required.

url

path / required

The remote server where the backup should be sent. The vCenter server must be able to access this location.

This should be a url in the format of protocol://server-address<:port-number>/folder/subfolder

The protocols supported for backup are FTPS, HTTPS, SFTP, FTP, NFS, SMB and HTTP.

username

string

The username to use to authenticate to the location URL, if one is required.

name

string

The name of the backup schedule. This must be unique, and is used as an identifier for the schedule.

Your VCSA may only allow for one schedule. If you create this schedule via the web UI, its name is ‘default’.

You can change the name by deleting the existing schedule and creating a new one with a new name.

Default: "default"

password

aliases: pass, pwd

string

The password of the vSphere vCenter server.

If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.

port

integer

The port number of the vSphere vCenter server.

If the value is not specified in the task, the value of environment variable VMWARE_PORT will be used instead.

Default: 443

proxy_host

string

The address of a proxy that will receive all HTTPS requests and relay them.

The format is a hostname or a IP.

If the value is not specified in the task, the value of environment variable VMWARE_PROXY_HOST will be used instead.

proxy_port

integer

The port of the HTTP proxy that will receive all HTTPS requests and relay them.

If the value is not specified in the task, the value of environment variable VMWARE_PROXY_PORT will be used instead.

proxy_protocol

aliases: protocol

string

The proxy connection protocol to use.

This option is used if the correct proxy protocol cannot be automatically determined.

Choices:

  • "http"

  • "https" ← (default)

retain_count

integer

The number of backups to retain.

If this is set to 0, all backups are kept.

Default: 3

schedule

dictionary

Options describing the timing and recurrence of the backup schedule.

days_of_week

list / elements=string / required

The days of the week that this backup should be run.

At least one day should be selected.

Options are MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY

hour

integer / required

The hour of the day in 24-hour format that this backup should be run.

minute

integer / required

The minute of the hour that this backup should be run.

state

string

Whether the schedule should be present or absent.

Choices:

  • "present" ← (default)

  • "absent"

username

aliases: admin, user

string

The username of the vSphere vCenter server.

If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.

validate_certs

boolean

Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.

If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.

Choices:

  • false

  • true ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: full

The check_mode support.

Notes

Note

  • All modules require API write access and hence are not supported on a free ESXi license.

  • All variables and VMware object names are case sensitive.

  • Modules may rely on the ‘requests’ python library, which does not use the system certificate store by default. You can specify the certificate store by setting the REQUESTS_CA_BUNDLE environment variable. Note having this variable set may cause a ‘false’ value for the ‘validate_certs’ option to be ignored in some cases. Example: ‘export REQUESTS_CA_BUNDLE=/path/to/your/ca_bundle.pem’

Examples

- name: Configure The Default Schedule
  vmware.vmware.vcsa_backup_schedule:
    schedule:
      hour: 23
      minute: 59
      days_of_week:
        - saturday
    location:
      url: nfs://10.10.10.10:/nfs/iso_datastore/vcenterbackup/
      username: root
    retain_count: 3

- name: Remove The Default Schedule
  vmware.vmware.vcsa_backup_schedule:
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

schedule

dictionary

Dictionary identifying the schedule that was modified

Returned: always

Sample: {"name": "default"}

vcsa

dictionary

Identifying information about the appliance

Returned: always

Sample: {"vcsa": {"hostname": "my-appliance", "port": 443}}

Authors

  • Ansible Cloud Team (@ansible-collections)