From dd79bf3cf25c814521898f95353a1908ec249751 Mon Sep 17 00:00:00 2001 From: smolkik_adm Date: Mon, 22 Jun 2026 04:21:33 +0000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20nvidia-lxc-playbook.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvidia-lxc-playbook.yml | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 nvidia-lxc-playbook.yml diff --git a/nvidia-lxc-playbook.yml b/nvidia-lxc-playbook.yml new file mode 100644 index 0000000..f3fd93c --- /dev/null +++ b/nvidia-lxc-playbook.yml @@ -0,0 +1,46 @@ +--- +- name: Install NVIDIA driver in LXC + hosts: localhost + become: true + vars: + driver_url: "http://drop.smolkik.ru/NVIDIA-Linux-x86_64-580.159.04.run" + driver_file: "NVIDIA-Linux-x86_64-580.159.04.run" + + tasks: + - name: Install dependencies + apt: + name: + - build-essential + - dkms + - linux-headers-{{ ansible_kernel }} + state: present + update_cache: true + + - name: Download driver + get_url: + url: "{{ driver_url }}" + dest: "/root/{{ driver_file }}" + mode: "0755" + + - name: Blacklist nouveau + copy: + dest: /etc/modprobe.d/blacklist-nouveau.conf + content: | + blacklist nouveau + options nouveau modeset=0 + + - name: Update initramfs + command: update-initramfs -u + changed_when: true + + - name: Install NVIDIA driver + command: /bin/bash /root/{{ driver_file }} --no-kernel-modules --silent --accept-license --dkms + register: result + + - name: Verify + command: nvidia-smi + register: smi + changed_when: false + + - debug: + msg: "{{ smi.stdout_lines }}" \ No newline at end of file