summaryrefslogtreecommitdiff
path: root/roles/cloud/install/tasks/edis-kvm.yml
blob: d53c663195d754f5be714dff897f860d6b32b0ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
# https://documenter.getpostman.com/view/14802249/TzkyNLMQ#intro

- name: generate auth sessions from API
  delegate_to: localhost
  check_mode: no
  uri:
    url: "https://session.edis.at/kvm/v2/get/auth"
    method: POST
    body_format: form-urlencoded
    body:
      email: "{{ install.cloud.credentials.email }}"
      pw: "{{ install.cloud.credentials.password }}"
    status_code: 200
  register: edis_kvm_auth_session_response

- name: make sure server-id is in results
  assert:
    that: install.cloud.id in edis_kvm_auth_session_response.json.data

- name: retrieve auth session for server-id
  set_fact:
    edis_kvm_auth_session: "{{ edis_kvm_auth_session_response.json.data[install.cloud.id] }}"

- debug:
    var: edis_kvm_auth_session

## TODO: actually implement this
##   - generate installer ISO
##   - upload iso to public reachable server... (which one ???)
##   - @API: download custom iso
##   - @API: power off
##   - @API: mount custom iso
##   - @API: power on
##   - wait for installer to finish (@API get powerstate?)
##   - @API: umount custom iso
##   - @API: power on