From 333eff6a0aeefcbf573bbf5e725fc27b5b4cb9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Mon, 6 Dec 2021 20:10:25 +0000 Subject: roles/vmm: Setup and create vms on openbsd --- roles/vmm/tasks/facts.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 roles/vmm/tasks/facts.yml (limited to 'roles/vmm/tasks/facts.yml') 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 }}" -- cgit v1.2.3