From 98333a575e67e6427162955f7d149c1a17e98978 Mon Sep 17 00:00:00 2001 From: Adam DeConinck Date: Tue, 7 Jan 2020 23:17:26 +0000 Subject: [PATCH 1/2] Add CUDA repo package pin file to files Contents of pin file sourced from: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin Confirmed this file's contents are identical for all supported Ubuntu releases as of this date. --- files/cuda-ubuntu.pin | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 files/cuda-ubuntu.pin diff --git a/files/cuda-ubuntu.pin b/files/cuda-ubuntu.pin new file mode 100644 index 0000000..b050308 --- /dev/null +++ b/files/cuda-ubuntu.pin @@ -0,0 +1,3 @@ +Package: * +Pin: release l=NVIDIA CUDA +Pin-Priority: 600 From c2b80200c63d5e216afe90015fc58dfb64273e6d Mon Sep 17 00:00:00 2001 From: Adam DeConinck Date: Tue, 7 Jan 2020 23:19:59 +0000 Subject: [PATCH 2/2] copy pin file to apt preferences --- tasks/install-ubuntu.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/install-ubuntu.yml b/tasks/install-ubuntu.yml index 66dec37..301a906 100644 --- a/tasks/install-ubuntu.yml +++ b/tasks/install-ubuntu.yml @@ -4,6 +4,14 @@ 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" + - name: add key apt_key: url: "{{ nvidia_driver_ubuntu_cuda_repo_gpgkey_url }}"