Skip to content

Commit

Permalink
Merge pull request #38 from supertetelman/centos-8-support-2
Browse files Browse the repository at this point in the history
Add support for RHEL/CentOS 8
  • Loading branch information
dholt authored Jun 11, 2021
2 parents 9f83a51 + 1593a2f commit 768a1ed
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tasks/install-redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,27 @@
gpgkey: "{{ nvidia_driver_rhel_cuda_repo_gpgkey }}"
environment: "{{proxy_env if proxy_env is defined else {}}}"

- name: install driver packages
- name: install driver packages RHEL/CentOS 7 and older
yum:
name: "{{ nvidia_driver_package_version | ternary('nvidia-driver-latest-dkms-'+nvidia_driver_package_version, 'nvidia-driver-latest-dkms') }}"
state: "{{ nvidia_driver_package_state }}"
autoremove: "{{ nvidia_driver_package_state == 'absent' }}"
register: install_driver
register: install_driver_rhel7
environment: "{{proxy_env if proxy_env is defined else {}}}"
when: ansible_distribution_major_version < '8'

- name: install driver packages RHEL/CentOS 8 and newer
dnf:
name: "{{ nvidia_driver_package_version | ternary('@nvidia-driver:'+nvidia_driver_package_version, '@nvidia-driver:latest-dkms') }}"
state: "{{ nvidia_driver_package_state }}"
autoremove: "{{ nvidia_driver_package_state == 'absent' }}"
register: install_driver_rhel8
environment: "{{proxy_env if proxy_env is defined else {}}}"
when: ansible_distribution_major_version > '7'

- name: Set install_driver.changed var for RHEL 7/8
debug:
msg: Driver installed for RHEL
when: install_driver_rhel7.changed or install_driver_rhel8.changed
register: install_driver
changed_when: install_driver_rhel7.changed or install_driver_rhel8.changed

0 comments on commit 768a1ed

Please sign in to comment.