From 8c8dfbdb4368a50af10d8ea6c5b38bb95dbc7621 Mon Sep 17 00:00:00 2001 From: Carson Dunbar Date: Wed, 16 Oct 2024 20:21:16 +0000 Subject: [PATCH] Update to address PR review --- ansible/roles/enroot/meta/main.yml | 2 +- .../defaults/main.yml | 4 ++-- .../tasks/main.yml | 0 .../tasks/os/debian.yml | 12 ++---------- .../tasks/os/redhat.yml | 0 5 files changed, 5 insertions(+), 13 deletions(-) rename ansible/roles/{nvidia_container => nvidia_container_toolkit_repo}/defaults/main.yml (86%) rename ansible/roles/{nvidia_container => nvidia_container_toolkit_repo}/tasks/main.yml (100%) rename ansible/roles/{nvidia_container => nvidia_container_toolkit_repo}/tasks/os/debian.yml (76%) rename ansible/roles/{nvidia_container => nvidia_container_toolkit_repo}/tasks/os/redhat.yml (100%) 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/tasks/os/debian.yml b/ansible/roles/nvidia_container_toolkit_repo/tasks/os/debian.yml similarity index 76% rename from ansible/roles/nvidia_container/tasks/os/debian.yml rename to ansible/roles/nvidia_container_toolkit_repo/tasks/os/debian.yml index c1940456..ba4979f0 100644 --- a/ansible/roles/nvidia_container/tasks/os/debian.yml +++ b/ansible/roles/nvidia_container_toolkit_repo/tasks/os/debian.yml @@ -16,19 +16,11 @@ - name: Collect Nvidia Container Repo GPG Key ansible.builtin.get_url: url: "{{ nvidia_gpg_key_url }}" - dest: /tmp/gpgkey + dest: "{{ nvidia_deb_gpg_key }}" mode: '0644' force: true -- name: De-Armor Nvidia GPG key - command: "gpg --dearmor --no-tty -o {{ nvidia_deb_gpg_key }} /tmp/gpgkey" - changed_when: false - - name: Add Nvidia Container Repo ansible.builtin.apt_repository: - repo: "deb [arch=amd64 signed-by={{ nvidia_deb_gpg_key }}] {{ nvidia_repo_url }}/deb/$(ARCH) /" + repo: "deb [arch=amd64 signed-by={{ nvidia_deb_gpg_key }}] {{ nvidia_repo_url_deb }}/$(ARCH) /" filename: nvidia-container-toolkit.list - -- name: Update repositories cache - ansible.builtin.apt: - update_cache: yes 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