aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/init_vm_alpine.yml
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-12-02 18:36:25 +0100
committerbinary <me@rgoncalves.se>2020-12-02 18:36:25 +0100
commitc4edd14b8aaf65d1db86074b0109b89ae609d4b3 (patch)
tree94e123449ce228ce1bff2dcb701f72956b1ad72c /roles/vmm/tasks/init_vm_alpine.yml
parent8478e90356b6738a13eed3878000d0e112074960 (diff)
downloadinfrastructure-c4edd14b8aaf65d1db86074b0109b89ae609d4b3.tar.gz
Refactor based on bhyve setup
Diffstat (limited to 'roles/vmm/tasks/init_vm_alpine.yml')
-rw-r--r--roles/vmm/tasks/init_vm_alpine.yml50
1 files changed, 0 insertions, 50 deletions
diff --git a/roles/vmm/tasks/init_vm_alpine.yml b/roles/vmm/tasks/init_vm_alpine.yml
deleted file mode 100644
index 0c66a44..0000000
--- a/roles/vmm/tasks/init_vm_alpine.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-# vmm ~~ tasks/init_vm_alpine.yml
-
----
-
-- set_fact:
- iso: "{{ vms | selectattr('name', 'equalto', guest) | map(attribute='iso') | first }}"
-
-- include: set_facts.yml
-
-- name: Check for existing drive
- stat:
- path: "{{ disk_file }}"
- register: st_disk
-
-- fail:
- msg: "No empty disk detected ! You need to generated disks via hypervisor playbook"
- when: not st_disk.stat.exists
-
-- fail:
- msg: "Existing installation detected ! Manual action on host required"
- when: st_disk.stat.size > 500000
-
-- include_role:
- name: serial
-
-- name: Copy vm init script
- copy:
- src: init_vm_alpine.py
- dest: /data/python/init_vm_alpine.py
-
-- name: Stop vm if running
- shell: vmctl stop "{{ guest }}" ; vmctl stop vm-tmp
- ignore_errors: true
-
-- name: Start temporary vm
- shell: vmctl start -r {{ iso_latest }} -d {{ disk_file }} -n {{ vmm.switch.name }} -m 1G vm-tmp
-
-- name: Pause 30 seconds for vm boot
- pause:
- seconds: 30
-
-- name: Init vm via script
- command: python3 /data/python/init_vm_alpine.py \
- {{ guest }} \
- {{ hostvars[guest].ip.out }} \
- {{ hypervisor.gateway }} \
- {{ hypervisor.mask }} \
- {{ _i.dns[0] }} \
- "{{ lookup('file', inventory_dir + '/files/pubkeys/rgoncalves.pub') }}"
remember that computers suck.