
- name: Add nvidia-container-runtime apt signing key
  apt_key:
    url: https://nvidia.github.io/nvidia-container-runtime/gpgkey
    state: present
    validate_certs: no

- name: Add apt repository
  shell: "curl -s -L https://nvidia.github.io/nvidia-container-runtime/{{ ansible_distribution|lower }}{{ ansible_distribution_version }}/nvidia-container-runtime.list | tee /etc/apt/sources.list.d/nvidia-container-runtime.list"

- name: Update repositories cache and install nvidia-container-runtime
  apt:
    name: nvidia-container-runtime
    update_cache: yes
