From bdde2cb9096e78cebba99c1196b91c481fd7b492 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 11 Feb 2021 11:17:22 -0600 Subject: [PATCH] Only run driver install if final uninstall not found. --- local.yml | 2 +- tasks/miner/{driver => drivers}/amdgpu.yml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) rename tasks/miner/{driver => drivers}/amdgpu.yml (58%) diff --git a/local.yml b/local.yml index 760e444..be74f69 100644 --- a/local.yml +++ b/local.yml @@ -79,7 +79,7 @@ when: mine.xmr is defined # Ethereum - - include: tasks/miner/driver/amdgpu.yml + - include: tasks/miner/drivers/amdgpu.yml when: ansible_distribution == "Ubuntu" and mine.eth is defined - include: tasks/miner/gpu/eth/ethminer.yml diff --git a/tasks/miner/driver/amdgpu.yml b/tasks/miner/drivers/amdgpu.yml similarity index 58% rename from tasks/miner/driver/amdgpu.yml rename to tasks/miner/drivers/amdgpu.yml index ebf74de..34e6f2a 100644 --- a/tasks/miner/driver/amdgpu.yml +++ b/tasks/miner/drivers/amdgpu.yml @@ -1,17 +1,30 @@ --- # Install OpenCL drivers. +- name: Check If Installed + shell: 'which amdgpu-pro-uninstall' + register: amdgpu_installed + - name: Folder shell: 'mkdir -p Downloads' + when: amdgpu_installed.stdout == "" - name: Download shell: 'scp ling@leet:InstallFiles/Drivers/amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz Downloads/' + when: amdgpu_installed.stdout == "" - name: Extract shell: 'cd Downloads; tar -xvf amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz' + when: amdgpu_installed.stdout == "" - name: Install 1 - All shell: 'cd Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; amdgpu-install -y' + when: amdgpu_installed.stdout == "" - name: 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 == "" + +- name: Delete + shell: 'rm -rf Downloads/*' + when: amdgpu_installed.stdout == "" \ No newline at end of file