VMware VCSA 6.x backup using ansible

Recently, I have one project requirement where i have to use vmware rest api and ansible to take the vcsa backup. In this blog we will first explore vcsa apiexplorer and traverse to rest api for backup

we need to open: https:<vcsa fqdn or ip>/apiexplorer

Select the appliance from the drop down and traverse to the backup job

explore POST /appliance/recover/backup/job . It will have parameter values

These are the option we will be using while coding in ansible. parts option you can get from vcsa vami console.

SEAT is optional.

After exploring api, its time to look into ansible. First part would be login to vcsa apiexplore. This require authentication.

VCSA login using rest api /ansible code snip

As explain above for backup request body, same way for ansible we need write json file

Now we need to write the backup task in ansible yaml file

So backup.yaml will contain login and backup task. Backup task will be calling json file , which contain vcsa backup config info.