---
# tasks file for ansible-role-cuda
- name: Upload packaging key for CUDA repositories
  copy:
    src: cuda_packaging_key.asc
    dest: "{{ cuda_rpm_key_path }}"
    mode: 0644

- name: Trust packaging key for CUDA repositories
  rpm_key:
    key: "{{ cuda_rpm_key_path }}"
    id: "{{ cuda_packaging_key_id }}"
    state: present

- name: Configure CUDA repository for yum-based systems
  yum_repository:
    name: cuda
    description: Official Nvidia CUDA repository
    file: nvidia
    baseurl: "{{ cuda_repo_url }}/{{ cuda_repo_subfolder }}/x86_64/"
    gpgkey: "{{ cuda_rpm_key_path }}"
    gpgcheck: yes
    enabled: yes

- name: install cuda software - this is slow - restart if cuda_restart_node_on_install is True
  package:
    name: "{{ item }}"
    state: present
  with_items: "{{ cuda_packages | default({}) }}"
  register: cuda_packages_installation
  notify:
   - ZZ CUDA Restart server
   - ZZ CUDA Wait for server to restart


---
# tasks file for ansible-role-cuda
- name: Upload packaging key for CUDA repositories
  copy:
    src: cuda_packaging_key.asc
    dest: "{{ cuda_rpm_key_path }}"
    mode: 0644

- name: Trust packaging key for CUDA repositories
  rpm_key:
    key: "{{ cuda_rpm_key_path }}"
    state: present

- name: Remove trust for old CUDA packaging key
  rpm_key:
    key: 5C37D3BE
    state: absent

- name: Configure CUDA repository for yum-based systems
  yum_repository:
    name: cuda
    description: Official Nvidia CUDA repository
    file: nvidia
    baseurl: "{{ cuda_repo_url }}/{{ cuda_repo_subfolder }}/x86_64/"
    gpgkey: "{{ cuda_rpm_key_path }}"
    gpgcheck: yes
    enabled: yes

- name: install cuda software - this is slow - restart if cuda_restart_node_on_install is True
  package:
    name: "{{ item }}"
    state: present
  with_items: "{{ cuda_packages | default({}) }}"
  register: cuda_packages_installation
  notify:
   - ZZ CUDA Restart server
   - ZZ CUDA Wait for server to restart

Remove old GPGKEY, remove unsupported id param
Remove old GPGKEY, remove unsupported id param
