diff --git a/tasks/setup.yml b/tasks/setup.yml index ff7a6f3..48f428b 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -49,3 +49,21 @@ systemd: name: fstrim.timer enabled: true + +- name: disable nvidia GPU + block: + - name: create udev rule + become: true + template: + src: 'templates/{{ platform }}/udev.j2' + dest: '/etc/udev/rules.d/00-remove-nvidia.rules' + owner: root + group: root + - name: blacklist kernel module + become: true + template: + src: 'templates/{{ platform }}/nouveau-blacklist.j2' + dest: '/etc/modprobe.d/blacklist-nouveau.conf' + owner: root + group: root + when: platform == "laptop" diff --git a/templates/laptop/nouveau-blacklist.j2 b/templates/laptop/nouveau-blacklist.j2 new file mode 100644 index 0000000..0a4edd5 --- /dev/null +++ b/templates/laptop/nouveau-blacklist.j2 @@ -0,0 +1,4 @@ +# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }} + +blacklist nouveau +options nouveau modeset=0 diff --git a/templates/laptop/udev.j2 b/templates/laptop/udev.j2 new file mode 100644 index 0000000..8283502 --- /dev/null +++ b/templates/laptop/udev.j2 @@ -0,0 +1,4 @@ +# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }} + +# Remove NVIDIA VGA/3D controller devices +ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"