Open fdcastel opened 2 months ago
Workaround using Proxmox API:
vars:
proxmox:
node: MY_SAMPLE_NODE
vmid: 123
api_host: "{{ lookup('env', 'PROXMOX_API_HOST') }}"
api_port: "{{ lookup('env', 'PROXMOX_API_PORT') }}"
api_user: "{{ lookup('env', 'PROXMOX_API_USER') }}"
api_password: "{{ lookup('env', 'PROXMOX_API_PASSWORD') }}"
tasks:
- name: Request auth ticket
uri:
url: "https://{{ proxmox.api_host }}:{{ proxmox.api_port }}/api2/json/access/ticket"
method: POST
validate_certs: no
body_format: json
body: { "username": "{{ proxmox.api_user }}", "password": "{{ proxmox.api_password }}" }
register: ticket_response
- name: Set console mode to shell
uri:
url: "https://{{ proxmox.api_host }}:{{ proxmox.api_port }}/api2/json/nodes/{{ proxmox.node }}/lxc/{{ proxmox.vmid }}/config"
method: PUT
validate_certs: no
headers:
Cookie: "PVEAuthCookie={{ ticket_response.json.data.ticket }}"
CSRFPreventionToken: "{{ ticket_response.json.data.CSRFPreventionToken }}"
body_format: json
body: { "cmode": "shell" }
cc @Ajpantuso @Thulium-Drake @UnderGreen @joshainglis @karmab @krauthosting click here for bot help
Summary
I just noticed the missing equivalent of the
--cmode
switch in thepct create
command:Via Web UI:
Issue Type
Feature Idea
Component Name
proxmox
Additional Information
I often create containers with
--cmode shell
.It's very useful since it allows faster access to the LXC console without login.
Code of Conduct