Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to new NVIDIA signing key #59

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ By default, the Canonical repositories will be used, and the driver installed wi
| -------- | ------------- | ----------- |
| `nvidia_driver_ubuntu_install_from_cuda_repo` | `no` | Flag whether to use the CUDA repo |
| `nvidia_driver_ubuntu_cuda_repo_baseurl` | `"http://developer.download.nvidia.com/compute/cuda/repos/{{ _ubuntu_repo_dir }}"` | Base URL to use for CUDA repo |
| `nvidia_driver_ubuntu_cuda_repo_gpgkey_url` | `"https://developer.download.nvidia.com/compute/cuda/repos/{{ _ubuntu_repo_dir }}/7fa2af80.pub"` | GPG key for the CUDA repo |
| `nvidia_driver_ubuntu_cuda_repo_gpgkey_id` | `"7fa2af80"` | GPG key ID for the CUDA repo |
| `nvidia_driver_ubuntu_cuda_package` | `"cuda-drivers"` | Package name to install from CUDA repo |

## Example playbook
Expand Down
7 changes: 4 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nvidia_driver_branch: "510"
epel_package: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
epel_repo_key: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}"
nvidia_driver_rhel_cuda_repo_baseurl: "https://developer.download.nvidia.com/compute/cuda/repos/{{ _rhel_repo_dir }}/"
nvidia_driver_rhel_cuda_repo_gpgkey: "https://developer.download.nvidia.com/compute/cuda/repos/{{ _rhel_repo_dir }}/7fa2af80.pub"
nvidia_driver_rhel_cuda_repo_gpgkey: "https://developer.download.nvidia.com/compute/cuda/repos/{{ _rhel_repo_dir }}/D42D0685.pub"

nvidia_driver_rhel_branch: "{{ nvidia_driver_branch }}"

Expand All @@ -37,7 +37,8 @@ nvidia_driver_ubuntu_packages:
- "nvidia-kernel-source-{{ nvidia_driver_ubuntu_branch }}-server"

# Installing with CUDA repositories
nvidia_driver_ubuntu_cuda_repo_gpgkey_url: "https://developer.download.nvidia.com/compute/cuda/repos/{{ _ubuntu_repo_dir }}/7fa2af80.pub"
nvidia_driver_ubuntu_cuda_repo_gpgkey_id: "7fa2af80"
old_nvidia_driver_ubuntu_cuda_repo_gpgkey_id: "7fa2af80"
nvidia_driver_ubuntu_cuda_repo_baseurl: "https://developer.download.nvidia.com/compute/cuda/repos/{{ _ubuntu_repo_dir }}"
nvidia_driver_ubuntu_cuda_keyring_package: "cuda-keyring_1.0-1_all.deb"
nvidia_driver_ubuntu_cuda_keyring_url: "{{ nvidia_driver_ubuntu_cuda_repo_baseurl }}/{{ nvidia_driver_ubuntu_cuda_keyring_package }}"
nvidia_driver_ubuntu_cuda_package: "cuda-drivers-{{ nvidia_driver_ubuntu_branch }}"
3 changes: 0 additions & 3 deletions files/cuda-ubuntu.pin

This file was deleted.

34 changes: 15 additions & 19 deletions tasks/install-ubuntu-cuda-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,26 @@
repo: ppa:graphics-drivers/ppa
state: absent

- name: add pin file
copy:
src: "cuda-ubuntu.pin"
dest: "/etc/apt/preferences.d/cuda-repository-pin-600"
owner: "root"
group: "root"
mode: "0644"
dholt marked this conversation as resolved.
Show resolved Hide resolved
- name: remove old signing key
apt_key:
id: "{{ old_nvidia_driver_ubuntu_cuda_repo_gpgkey_id }}"
state: absent
environment: "{{proxy_env if proxy_env is defined else {}}}"
when: nvidia_driver_add_repos | bool

- name: add key
apt_key:
url: "{{ nvidia_driver_ubuntu_cuda_repo_gpgkey_url }}"
id: "{{ nvidia_driver_ubuntu_cuda_repo_gpgkey_id }}"
- name: add CUDA keyring
apt:
deb: "{{ nvidia_driver_ubuntu_cuda_keyring_url }}"
state: "present"
environment: "{{proxy_env if proxy_env is defined else {}}}"
when: nvidia_driver_add_repos | bool

- name: esure kmod is installed
- name: force an apt update
apt:
update_cache: true
changed_when: false

- name: ensure kmod is installed
apt:
name: "kmod"
state: "present"
Expand All @@ -30,13 +33,6 @@
name: nouveau
state: present

- name: add repo
apt_repository:
repo: "deb {{ nvidia_driver_ubuntu_cuda_repo_baseurl }} /"
update_cache: yes
environment: "{{proxy_env if proxy_env is defined else {}}}"
when: nvidia_driver_add_repos | bool

dholt marked this conversation as resolved.
Show resolved Hide resolved
- name: install driver packages
apt:
name: "{{ nvidia_driver_package_version | ternary(nvidia_driver_ubuntu_cuda_package+'='+nvidia_driver_package_version, nvidia_driver_ubuntu_cuda_package) }}"
Expand Down