diff --git a/ansible/roles/enroot/meta/main.yml b/ansible/roles/enroot/meta/main.yml index 6ab4b04a..b2d65a10 100644 --- a/ansible/roles/enroot/meta/main.yml +++ b/ansible/roles/enroot/meta/main.yml @@ -14,5 +14,5 @@ # limitations under the License. dependencies: -- role: nvidia_container +- role: nvidia_container_toolkit_repo when: enroot_install_optional_deps diff --git a/ansible/roles/nvidia_container/defaults/main.yml b/ansible/roles/nvidia_container_toolkit_repo/defaults/main.yml similarity index 86% rename from ansible/roles/nvidia_container/defaults/main.yml rename to ansible/roles/nvidia_container_toolkit_repo/defaults/main.yml index fdc2bacf..278e2051 100644 --- a/ansible/roles/nvidia_container/defaults/main.yml +++ b/ansible/roles/nvidia_container_toolkit_repo/defaults/main.yml @@ -15,5 +15,5 @@ nvidia_gpg_key_url: https://nvidia.github.io/libnvidia-container/gpgkey nvidia_repo_url_deb: https://nvidia.github.io/libnvidia-container/stable/deb -nvidia_gpg_key_deb: /etc/apt/keyrings/nvidia-container-toolkit-keyring.gpg -nvidia_repo_file_rhel: https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo +nvidia_gpg_key_deb: /etc/apt/keyrings/nvidia-container-toolkit-keyring.asc +nvidia_repo_file_rpm: https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo diff --git a/ansible/roles/nvidia_container/tasks/main.yml b/ansible/roles/nvidia_container_toolkit_repo/tasks/main.yml similarity index 100% rename from ansible/roles/nvidia_container/tasks/main.yml rename to ansible/roles/nvidia_container_toolkit_repo/tasks/main.yml diff --git a/ansible/roles/nvidia_container_toolkit_repo/tasks/os/debian.yml b/ansible/roles/nvidia_container_toolkit_repo/tasks/os/debian.yml new file mode 100644 index 00000000..ba4979f0 --- /dev/null +++ b/ansible/roles/nvidia_container_toolkit_repo/tasks/os/debian.yml @@ -0,0 +1,26 @@ +--- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: Collect Nvidia Container Repo GPG Key + ansible.builtin.get_url: + url: "{{ nvidia_gpg_key_url }}" + dest: "{{ nvidia_deb_gpg_key }}" + mode: '0644' + force: true + +- name: Add Nvidia Container Repo + ansible.builtin.apt_repository: + repo: "deb [arch=amd64 signed-by={{ nvidia_deb_gpg_key }}] {{ nvidia_repo_url_deb }}/$(ARCH) /" + filename: nvidia-container-toolkit.list diff --git a/ansible/roles/nvidia_container/tasks/os/redhat.yml b/ansible/roles/nvidia_container_toolkit_repo/tasks/os/redhat.yml similarity index 100% rename from ansible/roles/nvidia_container/tasks/os/redhat.yml rename to ansible/roles/nvidia_container_toolkit_repo/tasks/os/redhat.yml