diff options
author | Christian Pointner <equinox@spreadspace.org> | 2022-12-31 18:06:30 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2022-12-31 18:06:30 +0100 |
commit | 9e6bd813bfe399caf2d153c751145db4e601ec59 (patch) | |
tree | c6e113a50a6327969462814ac7515ca0c295d70c /roles/cloud/install/tasks/edis-kvm.yml | |
parent | vm/guest: fix pci passthrough (diff) |
finalize cloud-kvm for edis-kvm for now
Diffstat (limited to 'roles/cloud/install/tasks/edis-kvm.yml')
-rw-r--r-- | roles/cloud/install/tasks/edis-kvm.yml | 67 |
1 files changed, 23 insertions, 44 deletions
diff --git a/roles/cloud/install/tasks/edis-kvm.yml b/roles/cloud/install/tasks/edis-kvm.yml index 43bb6d52..f2ebe750 100644 --- a/roles/cloud/install/tasks/edis-kvm.yml +++ b/roles/cloud/install/tasks/edis-kvm.yml @@ -7,6 +7,7 @@ vars: installer_base_path: "{{ global_cache_dir }}/debian-installer" installer_keyrings_path: "{{ global_files_dir }}/common/keyrings" + debian_preseed_poweroff_when_done: yes import_role: name: installer/debian/iso @@ -81,7 +82,7 @@ set_fact: edis_kvm_custom_iso_fullpath: "{{ edis_kvm_installer_isos.json.data | select('match', '.*/' + install.cloud.id + '.iso') | first }}" -- name: mount custom iso +- name: mount and boot from custom iso delegate_to: localhost uri: url: "https://{{ edis_kvm_auth_session.api_host }}/kvm/v2/set/mount" @@ -92,61 +93,39 @@ signature: "{{ edis_kvm_auth_session.signature }}" valid_until: "{{ edis_kvm_auth_session.valid_until }}" iso: "{{ edis_kvm_custom_iso_fullpath }}" + force_reset: "yes" status_code: 200 -- name: make sure VNC access is disabled - delegate_to: localhost - uri: - url: "https://{{ edis_kvm_auth_session.api_host }}/kvm/v2/set/vnc/disable" - method: POST - body_format: form-urlencoded - body: - kvm_id: "{{ edis_kvm_auth_session.kvm_id }}" - signature: "{{ edis_kvm_auth_session.signature }}" - valid_until: "{{ edis_kvm_auth_session.valid_until }}" - status_code: 200 - -- name: wait for VNC disable to kick in +- name: installing the system pause: - seconds: 5 + minutes: 3 + prompt: | + Waiting for the installer to finish. You may watch the progress via the EDIS Managemet interface at -- name: generate random password for VNC access - set_fact: - edis_kvm_vnc_password: "{{ lookup('password', '/dev/null chars=ascii_lowercase,ascii_uppercase,digits length=8') }}" + https://manage.edis.at/whmcs/clientarea.php?action=services - ## TODO: sadly setting the password does not work -> create ticket @ edis support .... -- name: (re)enable VNC access with new temporary password + Just go to the product page of the VM {{ install.cloud.id }} and enable VNC. After that you may use the + built-in noVNC instance to watch the installer doing its thing. + + The installer will terminate the VM when done and the install process will continue automatically. + If the installation is done quicker than this you may press ENTER to continue or CTRL-C then A to abort. + +- name: wait for installer to shutdown the VM delegate_to: localhost uri: - url: "https://{{ edis_kvm_auth_session.api_host }}/kvm/v2/set/vnc/enable" + url: "https://{{ edis_kvm_auth_session.api_host }}/kvm/v2/get/power" method: POST body_format: form-urlencoded body: kvm_id: "{{ edis_kvm_auth_session.kvm_id }}" signature: "{{ edis_kvm_auth_session.signature }}" valid_until: "{{ edis_kvm_auth_session.valid_until }}" - vnc_pw: "{{ edis_kvm_vnc_password }}" - status_code: 200 - register: edis_kvm_vnc_info - -- name: user interaction needed... - pause: - prompt: | - Please connect to the VNC using the following link: - - https://manage.edis.at/novnc/?host={{ edis_kvm_vnc_info.json.vnc_host }}&port={{ edis_kvm_vnc_info.json.novnc_port }}&scale=true - - Alternativly you may connect to the VNC server at {{ edis_kvm_vnc_info.json.vnc_host }} on port {{ edis_kvm_vnc_info.json.vnc_port }} using any VNC compatible client. - - The VNC session is protected using this password: "{{ edis_kvm_vnc_password }}" - - While VNC is connected reboot the server (i.e. using CTRL+ALT+DEL) and then press F12 or ESC during the BIOS phase of - the boot. At the boot device selection menu select the DVD/CD drive entry that contains the string '(ISOIMAGE)' to - boot the installer. - - Once the installation is done press ENTER to continue or CTRL-C then A to abort. + register: edis_kvm_power_state + until: "edis_kvm_power_state.json.data == 'server powered off'" + retries: 60 + delay: 5 -- name: unount the installer iso image +- name: unmount the installer iso image delegate_to: localhost uri: url: "https://{{ edis_kvm_auth_session.api_host }}/kvm/v2/set/umount" @@ -158,10 +137,10 @@ valid_until: "{{ edis_kvm_auth_session.valid_until }}" status_code: 200 -- name: disable VNC access +- name: start the newly installed VM delegate_to: localhost uri: - url: "https://{{ edis_kvm_auth_session.api_host }}/kvm/v2/set/vnc/disable" + url: "https://{{ edis_kvm_auth_session.api_host }}/kvm/v2/set/poweron" method: POST body_format: form-urlencoded body: |