aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/facts.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vmm/tasks/facts.yml')
-rw-r--r--roles/vmm/tasks/facts.yml14
1 files changed, 14 insertions, 0 deletions
diff --git a/roles/vmm/tasks/facts.yml b/roles/vmm/tasks/facts.yml
new file mode 100644
index 0000000..7cf4f0c
--- /dev/null
+++ b/roles/vmm/tasks/facts.yml
@@ -0,0 +1,14 @@
+- name: generate lladdr variable for virtual machines
+ set_fact:
+ tmp_vms: >
+ {{ tmp_vms | default([]) + [ item | combine({
+ 'lladdr': item.name
+ | hash('sha1')
+ | truncate(12, True, '')
+ | ansible.netcommon.hwaddr('unix')
+ }) ] }}
+ loop: "{{ __vms }}"
+
+- name: save variables
+ set_fact:
+ __vms: "{{ tmp_vms }}"
remember that computers suck.