20 lines
855 B
YAML
20 lines
855 B
YAML
---
|
|
# Must run after roles/k8s_worker has generated /etc/containerd/config.toml —
|
|
# k8s_worker regenerates that file from scratch and would wipe this out if it
|
|
# ran afterwards. Run setup_gpu.yml only after setup_worker_plane.yml.
|
|
- name: Containerd | Check for nvidia runtime section
|
|
ansible.builtin.command: grep -q 'runtimes.nvidia' /etc/containerd/config.toml
|
|
register: _nvidia_runtime_present
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Containerd | Configure nvidia runtime
|
|
ansible.builtin.command: nvidia-ctk runtime configure --runtime=containerd
|
|
when: _nvidia_runtime_present.rc != 0
|
|
notify: Restart containerd
|
|
|
|
- name: Containerd | Set nvidia as default runtime
|
|
ansible.builtin.command: nvidia-ctk runtime configure --runtime=containerd --set-as-default
|
|
when: _nvidia_runtime_present.rc != 0
|
|
notify: Restart containerd
|