I need a way to speed up my playbook, maybe better logical structuring.
It’s running sequentially now. The task is simple – run playbook from AWX
that will backup list of VMs.
I’m supplying list of VMs in AWX extra variables:
backupList:
- vmName: VM1
backupAge: 2d
- vmName: VM2
backupAge: 5d
- vmName: VM3
backupAge: 1d
backupDirectory:/vmfs/volumes/NFS_BACKUPS
The first playbook is simple:
- name: Process VM backup here
include_tasks: processBackup.yml
vars:
vm_name: "{{ item.vmName }}"
backupAge: "{{ item.backupAge }}"
with_items: "{{ backupList }}"
It reads extra variables and loops through calling second playbook using
“include_tasks” where all functionality is written: cloning VM, copy to NFS
server and making sure we keep the defined amount of copies.
Basically the same set of tasks performed with different VM names and
backup age. In this configuration, it is executed sequentially and takes a
long time, especially the copy part to a backup server.
So, I'm wondering if there is a better way to restructure the code to run
tasks simultaneously for each VM name?
Thanks
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/baab3a3e-acdf-430c-8565-5e667603b2f6%40googlegroups.com.