aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/facts.yml
blob: ef1bfa61a3b8ffe2e8d60b11425cf30129c0c513 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---

- name: generate lladdr variable for virtual machines
  ansible.builtin.set_fact:
    vmm_vms_tmp: >
      {{ vmm_vms_tmp | default([]) + [ item | combine({
        "lladdr": item.name
          | hash("sha1")
          | truncate(12, True, "")
          | ansible.netcommon.hwaddr("unix")
        | regex_replace(':(.):', ':0\1:')
        }) ] }}
  loop: "{{ vmm_vms }}"

- name: save variables
  ansible.builtin.set_fact:
    vmm_vms: "{{ vmm_vms_tmp }}"
remember that computers suck.