renamed vars to use 'lxc' prefix instead of 'container'
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user