Skip to content

Commit

Permalink
split rhel7/rhel8 install_driver register to avoid overwriting the va…
Browse files Browse the repository at this point in the history
…lue when skipped
  • Loading branch information
supertetelman committed Jun 10, 2021
1 parent 165b6a8 commit 1593a2f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tasks/install-redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
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'

Expand All @@ -61,6 +61,13 @@
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
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 1593a2f

Please sign in to comment.