diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2021-12-08 17:05:40 +0000 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2021-12-08 17:52:52 +0000 |
commit | 9b412021df062a0e1fafadc7301aacea44c9f75d (patch) | |
tree | 90f9ed57fcb7c4309d13426c2b0fdf8bfa558906 /roles/vmm/tasks | |
parent | 93b7a96d2e13c21d069fb7680b7c89dbbb4673a4 (diff) | |
download | rules-9b412021df062a0e1fafadc7301aacea44c9f75d.tar.gz |
roles/vmm: Append disks informations to guests
Diffstat (limited to 'roles/vmm/tasks')
-rw-r--r-- | roles/vmm/tasks/disk.yml | 14 |
1 files changed, 14 insertions, 0 deletions
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 }}" |