aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/facts.yml
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-06 20:10:25 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-07 20:24:51 +0000
commit333eff6a0aeefcbf573bbf5e725fc27b5b4cb9f6 (patch)
tree1f06800c26e23bb272af02d45fe4d73f4f2a091e /roles/vmm/tasks/facts.yml
parent4e542a8e15596421a9120cf700f0d4d12dbf6688 (diff)
downloadrules-333eff6a0aeefcbf573bbf5e725fc27b5b4cb9f6.tar.gz
roles/vmm: Setup and create vms on openbsd
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.