I receive following error from the Proxmox-API (v8.1.10):
{"sshkeys": "invalid format - invalid urlencoded string: ssh-rsa%20AA.................................%20eom\n"}}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Parameter verification failed.", "pragma": "no-cache", "redirected": false, "server": "pve-api-daemon/3.0", "status": 400, "url": "https://proxmox:8006/api2/json/nodes/cluster01/qemu/5000/config"}
The same issue seems to be reported here, but the solution is not applicable. Sorry for posting there, but without response:
https://forum.proxmox.com/threads/sshkeys-invalid-format-invalid-urlencoded-string.126202/
{{ | urlencode }} does its job in the Ansible task (There are no "\n" or "+").
However, "\n" is appended to the content of the sshkey-variable in the error message back from the Proxmox server.
The code runs without the sshkeys line in the Ansible task below. ("ciuser" and "cipassword").
My Ansible task look like:
What is the problem here? Thanks for any help!
{"sshkeys": "invalid format - invalid urlencoded string: ssh-rsa%20AA.................................%20eom\n"}}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Parameter verification failed.", "pragma": "no-cache", "redirected": false, "server": "pve-api-daemon/3.0", "status": 400, "url": "https://proxmox:8006/api2/json/nodes/cluster01/qemu/5000/config"}
The same issue seems to be reported here, but the solution is not applicable. Sorry for posting there, but without response:
https://forum.proxmox.com/threads/sshkeys-invalid-format-invalid-urlencoded-string.126202/
{{ | urlencode }} does its job in the Ansible task (There are no "\n" or "+").
However, "\n" is appended to the content of the sshkey-variable in the error message back from the Proxmox server.
The code runs without the sshkeys line in the Ansible task below. ("ciuser" and "cipassword").
My Ansible task look like:
YAML:
- name: configure vm
uri:
url: "https://{{ server_url }}:8006/api2/json/nodes/{{ node }}/qemu/{{ vmid_next | trim }}/config"
method: POST
return_content: yes
body_format: json
use_proxy: no
validate_certs: no
timeout: 5
headers:
Authorization: "PVEAPIToken=..."
Content-Type: "application/json"
body:
[...]
ciuser: "{{ inventory_settings__pve_vm_username }}"
sshkeys: "{{ inventory_settings__pve_vm_public_key | trim | urlencode }}"
[...]
What is the problem here? Thanks for any help!
Last edited: