i need to send keys to the vm when it boots .
looking to the api , i found
i am trying to do something like that:
- name: send keys
uri:
url: "{{ proxmox_rest_api_url }}/{{ proxmox_node }}/qemu/{{proxmox_vmid}}/sendkey"
validate_certs: no
use_proxy: no
method: PUT
body_format: json
body:
{
"key": "{{ item }}",
"node": "{{ proxmox_node }}",
"vmid": "{{ proxmox_vmid }}",
}
headers:
Content-Type: "application/json"
Cookie: "{{ ticket }}"
CSRFPreventionToken: "{{ ticket }}"
loop:
- kp_enter
- kp_enter
- spc
- spc
And i get this response:
"Status code was -1 and not [200]: An unknown error occurred: expected string or bytes-like object",
looking to the api , i found
HTTP: | PUT /api2/json/nodes/{node}/qemu/{vmid}/sendkey |
i am trying to do something like that:
- name: send keys
uri:
url: "{{ proxmox_rest_api_url }}/{{ proxmox_node }}/qemu/{{proxmox_vmid}}/sendkey"
validate_certs: no
use_proxy: no
method: PUT
body_format: json
body:
{
"key": "{{ item }}",
"node": "{{ proxmox_node }}",
"vmid": "{{ proxmox_vmid }}",
}
headers:
Content-Type: "application/json"
Cookie: "{{ ticket }}"
CSRFPreventionToken: "{{ ticket }}"
loop:
- kp_enter
- kp_enter
- spc
- spc
And i get this response:
"Status code was -1 and not [200]: An unknown error occurred: expected string or bytes-like object",