Hi
I'm new to using ansible, I'm writing a playbook to install a vm from template,
everything works fine except for the disk names which stay the same as the template. The
vm has more than one disk attached, I found this works for renaming the disk, but it only
renames 1. how can I rename the others too?
- name: Print vm attributes
ovirt.ovirt.ovirt_vm_info:
auth: "{{ ovirt_auth }}"
pattern: name="{{ vm_fqdn }}"
fetch_nested: true
register: vm_info
- debugging:
msg: "{{ vm_info.ovirt_vms[0] }}"
- name: Rename disk
ovirt.ovirt.ovirt_disk:
auth: "{{ ovirt_auth }}"
id: "{{ vm_info.ovirt_vms[0].id }}"
storage_domain: lrg0-ovirt-mydom-internal-Local
name: "{{ vm_fqdn }}-osdisk0"
vm_name: "{{ vm_fqdn }}"
Thanks
Regards