Using this module, you can create a backup of a VMware ESXi host configuration:
- name: Create an esxi host configuration backup vmware_cfg_backup: hostname: "{{ vsphere_host }}" username: "{{ vsphere_username }}" password: "{{ vsphere_password }}" validate_certs: "no" state: "saved" dest: "/tmp/" esxi_hostname: "{{ exsi_host }}" delegate_to: "localhost" register: cfg_backup
Please note that this module will automatically put the host into maintenance and then save the configuration too. In the preceding example, from /tmp, you can use the information registered to grab a copy of the backup using the fetch module.
You can also use this module to restore a configuration:
- name: Restore an esxi host configuration ...