-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
eric o meehan
committed
Aug 1, 2024
1 parent
8946eef
commit f543f72
Showing
5 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
- name: add contrib & non-free repository | ||
replace: | ||
dest: /etc/apt/sources.list | ||
regexp: '^(deb(?!.* contrib).*)' | ||
replace: '\1 contrib non-free' | ||
|
||
- name: remove old signing key | ||
apt_key: | ||
id: "{{ old_nvidia_driver_debian_cuda_repo_gpgkey_id }}" | ||
state: absent | ||
environment: "{{proxy_env if proxy_env is defined else {}}}" | ||
when: nvidia_driver_add_repos | bool | ||
|
||
- name: add CUDA keyring | ||
apt: | ||
deb: "{{ nvidia_driver_debian_cuda_keyring_url }}" | ||
state: "present" | ||
environment: "{{proxy_env if proxy_env is defined else {}}}" | ||
when: nvidia_driver_add_repos | bool | ||
|
||
- name: force an apt update | ||
apt: | ||
update_cache: true | ||
changed_when: false | ||
|
||
- name: ensure kmod is installed | ||
apt: | ||
name: "kmod" | ||
state: "present" | ||
|
||
- name: blacklist nouveau | ||
kernel_blacklist: | ||
name: nouveau | ||
state: present | ||
|
||
- name: install Linux headers and non-free firmware | ||
apt: | ||
name: | ||
- linux-headers-{{ ansible_kernel }} | ||
- firmware-misc-nonfree | ||
state: present | ||
|
||
- name: install driver packages | ||
apt: | ||
name: "{{ nvidia_driver_package_version | ternary(nvidia_driver_debian_cuda_package+'='+nvidia_driver_package_version, nvidia_driver_debian_cuda_package) }}" | ||
state: "{{ nvidia_driver_package_state }}" | ||
autoremove: "{{ nvidia_driver_package_state == 'absent' }}" | ||
purge: "{{ nvidia_driver_package_state == 'absent' }}" | ||
register: install_driver | ||
environment: "{{proxy_env if proxy_env is defined else {}}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
- name: add contrib & non-free repository | ||
replace: | ||
dest: /etc/apt/sources.list | ||
regexp: '^(deb(?!.* contrib).*)' | ||
replace: '\1 contrib non-free' | ||
|
||
- name: update apt | ||
become: yes | ||
apt: | ||
update_cache: yes | ||
|
||
- name: install Linux headers and non-free firmware | ||
apt: | ||
name: | ||
- linux-headers-{{ ansible_kernel }} | ||
- firmware-misc-nonfree | ||
state: present | ||
|
||
- name: install driver packages | ||
apt: | ||
name: "{{ nvidia_driver_package_version | ternary(item+'='+nvidia_driver_package_version, item) }}" | ||
state: "{{ nvidia_driver_package_state }}" | ||
autoremove: "{{ nvidia_driver_package_state == 'absent' }}" | ||
purge: "{{ nvidia_driver_package_state == 'absent' }}" | ||
loop: "{{ nvidia_driver_debian_packages }}" | ||
register: install_driver | ||
environment: "{{proxy_env if proxy_env is defined else {}}}" | ||
|
||
- name: install tesla drivers | ||
apt: | ||
state: present | ||
name: "{{ nvidia_driver_debian_tesla_package }}" | ||
register: install_driver | ||
when: nvidia_driver_debian_install_tesla_driver == true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
_debian_repo_dir: "{{ ansible_distribution | lower }}{{ ansible_distribution_version | replace('.', '') }}/{{ ansible_architecture }}" | ||
_ubuntu_repo_dir: "{{ ansible_distribution | lower }}{{ ansible_distribution_version | replace('.', '') }}/{{ ansible_architecture }}" | ||
_rhel_repo_dir: "rhel{{ ansible_distribution_major_version }}/{{ ansible_architecture }}" |