From e23695d52e0812b01dbf399514ba65e4ae0bf985 Mon Sep 17 00:00:00 2001 From: binary Date: Wed, 4 Nov 2020 20:29:21 +0100 Subject: Refactor --- roles/vmm/tasks/generate_vmconfig.yml | 5 ----- roles/vmm/tasks/init_alpine.yml | 31 ------------------------------- roles/vmm/vars/main.yml | 20 +++++++++++++++++--- 3 files changed, 17 insertions(+), 39 deletions(-) delete mode 100644 roles/vmm/tasks/generate_vmconfig.yml delete mode 100644 roles/vmm/tasks/init_alpine.yml (limited to 'roles') diff --git a/roles/vmm/tasks/generate_vmconfig.yml b/roles/vmm/tasks/generate_vmconfig.yml deleted file mode 100644 index 8d5609a..0000000 --- a/roles/vmm/tasks/generate_vmconfig.yml +++ /dev/null @@ -1,5 +0,0 @@ - -# vmm_deploy ~~ tasks/main.yml - ---- - diff --git a/roles/vmm/tasks/init_alpine.yml b/roles/vmm/tasks/init_alpine.yml deleted file mode 100644 index da0a33c..0000000 --- a/roles/vmm/tasks/init_alpine.yml +++ /dev/null @@ -1,31 +0,0 @@ - -# vmm ~~ tasks/init_alpine.yml - ---- - -- set_fact: - dest_symlink: "{{ vmm.iso.dir }}/{{ vmm.iso.alpine.name }}-latest.iso" - -- set_fact: - dest_iso: "{{ dest_symlink | regex_replace('latest', vmm.iso.alpine.version) }}" - url_iso: "{{ vmm.iso.alpine.url | regex_replace('VERSION', vmm.iso.alpine.version) }}" - -- name: Check latest Alpine iso on disk - stat: - path: "{{ dest_iso }}" - register: dest_result - -- name: Get latest Alpine iso - get_url: - url: "{{ url_iso }}" - dest: "{{ dest_iso }}" - checksum: "sha256:{{ url_iso }}.sha256" - when: not dest_result.stat.exists - -- name: Symlink latest iso - file: - src: "{{ dest_iso }}" - dest: "{{ dest_symlink }}" - #owner: "{{ vmm.user }}" - #group: "{{ vmm.group }}" - state: link diff --git a/roles/vmm/vars/main.yml b/roles/vmm/vars/main.yml index 3fc7743..22c59a7 100644 --- a/roles/vmm/vars/main.yml +++ b/roles/vmm/vars/main.yml @@ -8,17 +8,31 @@ vmm: user: "vmm" group: "vmm" + config: + file: "/etc/vm.conf" + switch: + name: "uplink" + interface: "bridge0" + + disk: + dir: "/data/vmm/disk.d" + format: "qcow2" + iso: - dir: "/data/vmm/iso/" + dir: "/data/vmm/iso.d" alpine: name: "alpine" - url: "http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-virt-VERSION-x86_64.iso" version: "3.12.1" + versiondir: "3.12" + url: "http://dl-cdn.alpinelinux.org/alpine/vVERSIONDIR/releases/x86_64/alpine-virt-VERSION-x86_64.iso" + sha256: "http://dl-cdn.alpinelinux.org/alpine/vVERSIONDIR/releases/x86_64/alpine-virt-VERSION-x86_64.iso.sha256" openbsd: name: "openbsd" - url: "https://cdn.openbsd.org/pub/OpenBSD/6.8/amd64/installVERSION.img" version: "68" + versiondir: "6.8" + url: "https://cdn.openbsd.org/pub/OpenBSD/VERSIONDIR/amd64/minirootVERSION.img" + sha256: "d3603291fa50bcf056fa304acf9311556331598f31dfbbbc6797ae88f43c948b" -- cgit v1.2.3