Set flags conditionally. Attempt to print them all on one action.

This commit is contained in:
Hyperling 2021-02-12 06:09:57 -06:00
parent 90d0cd0eb9
commit 666d7cff55

View File

@ -50,8 +50,36 @@
shell: 'cd /root/Downloads/ethminer; mkdir -p build' shell: 'cd /root/Downloads/ethminer; mkdir -p build'
when: ethminer_install.failed when: ethminer_install.failed
- name: Ethminer | Default Flags
set_fact:
opencl_flag: "OFF"
cuda_flag: "OFF"
dbus_flag: "OFF"
- name: Ethminer | Determine OPENCL Flag
set_fact:
opencl_flag: "ON"
when: amdgpu is defined
- name: Ethminer | Determine CUDA Flag
set_fact:
cuda_flag: "ON"
when: nvidia is defined
- name: Ethminer | Determine DBUS Flag
set_fact:
dbus_flag: "ON"
when: ansible_distribution == "Pop!_OS"
- name: Ethminer | Print Flags
debug:
var:
- opencl_flag
- cuda_flag
- dbus_flag
- name: Ethminer | cmake Flags - name: Ethminer | cmake Flags
shell: 'cd /root/Downloads/ethminer/build; cmake .. -DETHASHCL=ON -DETHASHCUDA=OFF -DAPICORE=ON -DBINKERN=ON -DETHDBUS=OFF -DUSE_SYS_OPENCL=OFF -DEVBUILD=ON' shell: 'cd /root/Downloads/ethminer/build; cmake .. -DETHASHCL={{ opencl_flag }} -DETHASHCUDA={{ cuda_flag }} -DAPICORE=ON -DBINKERN=ON -DETHDBUS={{ dbus_flag }} -DUSE_SYS_OPENCL=OFF -DEVBUILD=ON'
when: ethminer_install.failed when: ethminer_install.failed
- name: Ethminer | cmake Build - name: Ethminer | cmake Build