aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-08 17:05:40 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-08 17:52:52 +0000
commit9b412021df062a0e1fafadc7301aacea44c9f75d (patch)
tree90f9ed57fcb7c4309d13426c2b0fdf8bfa558906
parent93b7a96d2e13c21d069fb7680b7c89dbbb4673a4 (diff)
downloadrules-9b412021df062a0e1fafadc7301aacea44c9f75d.tar.gz
roles/vmm: Append disks informations to guests
-rw-r--r--roles/vmm/tasks/disk.yml14
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 }}"
remember that computers suck.