From 9b412021df062a0e1fafadc7301aacea44c9f75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Wed, 8 Dec 2021 17:05:40 +0000 Subject: roles/vmm: Append disks informations to guests --- roles/vmm/tasks/disk.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'roles/vmm') diff --git a/roles/vmm/tasks/disk.yml b/roles/vmm/tasks/disk.yml index 423d855..95427c6 100644 --- a/roles/vmm/tasks/disk.yml +++ b/roles/vmm/tasks/disk.yml @@ -13,3 +13,17 @@ find: path: "{{ vmm_disk_dir }}" patterns: "*.{{ vmm_disk_format }}" + register: result + +- name: append disks informations to vms facts + set_fact: + vmm_vms_tmp: > + {{ vmm_vms_tmp | default([]) + [ item | combine({ + "disk": result.files + | selectattr("path", "regex", item.name, ) + }) ] }} + loop: "{{ vmm_vms }}" + +- name: save variables + set_fact: + vmm_vms: "{{ vmm_vms_tmp }}" -- cgit v1.2.3