From 13f152dfe2e0a129fa5e925ae3e38667ec874d6e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 15 Feb 2021 20:22:48 -0600 Subject: [PATCH] Not all variables will always be defined. --- facts/miner/pool.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/facts/miner/pool.yml b/facts/miner/pool.yml index fa08bb2..a5bb613 100644 --- a/facts/miner/pool.yml +++ b/facts/miner/pool.yml @@ -36,24 +36,29 @@ - name: Miner | Facts | Pools | Set GPU to Nanopool Eth set_fact: cpu_pool: "{{ nanopool_xmr }}" - when: nanominer_cpu == "xmr" and nanominer_cpu_pool == "nanopool" + when: nanominer_cpu is defined and nanominer_cpu_pool is defined and + nanominer_cpu == "xmr" and nanominer_cpu_pool == "nanopool" + # GPU # - name: Miner | Facts | Pools | Set GPU to Nanopool Eth set_fact: gpu_pool: "{{ nanopool_eth }}" - when: nanominer_gpu == "eth" and nanominer_gpu_pool == "nanopool" + when: nanominer_gpu is defined and nanominer_gpu_pool is defined and + nanominer_gpu == "eth" and nanominer_gpu_pool == "nanopool" - name: Miner | Facts | Pools | Set GPU to Etherpool Eth set_fact: gpu_pool: "{{ ethermine_eth }}" - when: nanominer_gpu == "eth" and nanominer_gpu_pool == "etherpool" + when: nanominer_gpu is defined and nanominer_gpu_pool is defined and + nanominer_gpu == "eth" and nanominer_gpu_pool == "etherpool" - name: Miner | Facts | Pools | Set GPU to F2Pool Eth set_fact: gpu_pool: "{{ f2pool_eth }}" - when: nanominer_gpu == "eth" and nanominer_gpu_pool == "f2pool" + when: nanominer_gpu is defined and nanominer_gpu_pool is defined and + nanominer_gpu == "eth" and nanominer_gpu_pool == "f2pool"