renamed vars to use 'lxc' prefix instead of 'container'

This commit is contained in:
hiperman
2026-01-31 18:42:23 -05:00
parent 60fbe461be
commit 0a52e32f42
13 changed files with 174 additions and 176 deletions

View File

@@ -2,21 +2,21 @@
- name: Remove all existing ID mappings
lineinfile:
path: "/etc/pve/lxc/{{ container_vmid }}.conf"
path: "/etc/pve/lxc/{{ lxc_vmid }}.conf"
regexp: '^lxc\.idmap:'
state: absent
when: container_id_mappings is defined
when: lxc_id_mappings is defined
- name: Add ID mappings
blockinfile:
path: "/etc/pve/lxc/{{ container_vmid }}.conf"
block: "{{ container_id_mappings }}"
path: "/etc/pve/lxc/{{ lxc_vmid }}.conf"
block: "{{ lxc_id_mappings }}"
insertafter: EOF
when: container_id_mappings is defined
when: lxc_id_mappings is defined
- name: Remove existing GPU configuration
lineinfile:
path: "/etc/pve/lxc/{{ container_vmid }}.conf"
path: "/etc/pve/lxc/{{ lxc_vmid }}.conf"
regexp: "{{ item }}"
state: absent
loop:
@@ -26,11 +26,11 @@
- '^lxc\.mount\.entry: /dev/nvidiactl'
- '^lxc\.mount\.entry: /dev/nvidia-uvm '
- '^lxc\.mount\.entry: /dev/nvidia-uvm-tools'
when: container_nvidia_gpu_mount
when: lxc_nvidia_gpu_mount
- name: Add GPU device for passthrough
blockinfile:
path: /etc/pve/lxc/{{ container_vmid }}.conf
path: /etc/pve/lxc/{{ lxc_vmid }}.conf
block: |
lxc.cgroup2.devices.allow: c {{ gpu_device_id }}:* rwm
lxc.cgroup2.devices.allow: c {{ uvm_device_id }}:* rwm
@@ -38,6 +38,6 @@
lxc.mount.entry: /dev/nvidiactl dev/nvidiactl none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-uvm dev/nvidia-uvm none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-uvm-tools dev/nvidia-uvm-tools none bind,optional,create=file
when: container_nvidia_gpu_mount
when: lxc_nvidia_gpu_mount