Hi Jayme,here's my idea. I haven't tested it but I believe it should work.1. Create a new task file (let's call it export_vm.yaml) and include two tasks in there:1.1. First task uses ovirt_vm module (pretty much what you already have) to export VM1.2. Second task uses wait_for module (specifically its path parameter) to wait until the OVA file in /backup exists2. Loop over those two tasks as explained here.Hope this helps.JanOn Wed, Jan 22, 2020 at 4:15 PM Jayme <jaymef@gmail.com> wrote:_______________________________________________I wrote a simple task that is using the ovirt_vm module https://docs.ansible.com/ansible/latest/modules/ovirt_vm_module.html -- it essentially loops over a list of vms and exports them to OVA.
The problem I have is the task is deemed changed once it successfully submits the export task to oVirt. This means that if I gave it a list of 100 Vms I believe it would start an export task on all of them. I want to prevent this and have it only export one VM at a time. In order to do this I believe I will need to find a way for the task to wait and somehow verify that the export was completed before submitting a task for the next VM export.
Any ideas?
- name: Export the VM ovirt_vm: auth: "{{ ovirt_auth }}" name: "{{ item }}" state: exported cluster: default export_ova: host: Host0 filename: "{{ item }}" directory: /backup/ with_items: "{{ vms }}"
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/PXYAQ7YEBQCUWCAQCFAFXB3545LNB23X/
--