From 2f01321ee1d672e73d24e1f60a7ecf639ea00b75 Mon Sep 17 00:00:00 2001
From: Hyperling <me@hyperling.com>
Date: Thu, 11 Feb 2021 12:47:00 -0600
Subject: [PATCH] Catch the error in a better way.

---
 tasks/miner/drivers/amdgpu.yml | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/tasks/miner/drivers/amdgpu.yml b/tasks/miner/drivers/amdgpu.yml
index c1e16b1..81db9c8 100644
--- a/tasks/miner/drivers/amdgpu.yml
+++ b/tasks/miner/drivers/amdgpu.yml
@@ -4,6 +4,7 @@
 - name: AMDGPU | Check If Installed
   shell: 'which amdgpu-pro-uninstall'
   register: amdgpu_installed
+  ignore_errors: yes
 
 - name: AMDGPU | Debug
   debug:
@@ -11,24 +12,24 @@
 
 - name: AMDGPU | Folder
   shell: 'mkdir -p Downloads'
-  when: amdgpu_installed.stdout == ""
+  when: not amdgpu_installed.failed
 
 - name: AMDGPU | Download
   shell: 'scp ling@leet:InstallFiles/Drivers/amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz Downloads/'
-  when: amdgpu_installed.stdout == ""
+  when: not amdgpu_installed.failed
 
 - name: AMDGPU | Extract
   shell: 'cd Downloads; tar -xvf amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz'
-  when: amdgpu_installed.stdout == ""
+  when: not amdgpu_installed.failed
 
 - name: AMDGPU | Install 1 - All
   shell: 'cd Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; amdgpu-install -y'
-  when: amdgpu_installed.stdout == ""
+  when: not amdgpu_installed.failed
 
 - name: AMDGPU | Install 2 - Pro
   shell: 'cd Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; amdgpu-pro-install -y --opencl=pal,legacy'
-  when: amdgpu_installed.stdout == ""
+  when: not amdgpu_installed.failed
 
 - name: AMDGPU | Delete
   shell: 'rm -rf Downloads/*'
-  when: amdgpu_installed.stdout == ""
\ No newline at end of file
+  when: not amdgpu_installed.failed
\ No newline at end of file