From dfe3e285b47ae12cd195f5eee2718d868bcc4770 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 15 Feb 2021 16:03:34 -0600 Subject: [PATCH] Lol, error was due to the comma after the section name. I must have followed a bad example since documentation does not have them. Refactor file to be config for anything miner related and private. --- facts/miner/system.yml | 7 ++++--- facts/miner/wallet.yml | 40 +++------------------------------------- 2 files changed, 7 insertions(+), 40 deletions(-) diff --git a/facts/miner/system.yml b/facts/miner/system.yml index e323f66..0816fee 100644 --- a/facts/miner/system.yml +++ b/facts/miner/system.yml @@ -3,6 +3,7 @@ - name: Miner | Facts | System | Wallet Location set_fact: - wallet_server: 'ling@leet' - wallet_file_remote: "InstallFiles/Miners/wallet.ini" - wallet_file_local: "{{ user_mfn.home }}/wallet.ini" \ No newline at end of file + config_server: 'ling@leet' + config_file_remote: "InstallFiles/Miners/miner.ini" + config_file_local: "{{ user_mfn.home }}/miner.ini" + config_section_wallet: wallet \ No newline at end of file diff --git a/facts/miner/wallet.yml b/facts/miner/wallet.yml index 98d5437..6be6474 100644 --- a/facts/miner/wallet.yml +++ b/facts/miner/wallet.yml @@ -4,49 +4,15 @@ ## Load Config ## - name: Miner | Facts | Config File | Download - shell: "scp {{ wallet_server }}:{{ wallet_file_remote }} {{ wallet_file_local }}; chmod 700 {{ wallet_file_local }}" + shell: "scp {{ config_server }}:{{ config_file_remote }} {{ wallet_file_local }}; chmod 700 {{ config_file_local }}" - name: Miner | Facts | Config File | Load XMR set_fact: - wallet_xmr: "{{ lookup('ini', 'xmr, file={{wallet_file_local}}') }}" - when: wallet_file_local is file - ignore_errors: yes -- name: Miner | Facts | Config File | Load XMR - set_fact: - wallet_xmr: "{{ lookup('ini', 'xmr, section=null, file={{wallet_file_local}}') }}" - when: wallet_file_local is file - ignore_errors: yes -- name: Miner | Facts | Config File | Load XMR - set_fact: - wallet_xmr: "{{ lookup('ini', 'xmr, section=wallet, file={{wallet_file_local}}') }}" - when: wallet_file_local is file - ignore_errors: yes -- name: Miner | Facts | Config File | Load XMR - set_fact: - wallet_xmr: "{{ lookup('ini', 'xmr, section=global, file={{wallet_file_local}}') }}" - when: wallet_file_local is file - ignore_errors: yes + wallet_xmr: "{{ lookup('ini', 'xmr section={{config_section_wallet}} file={{config_file_local}}') }}" - name: Miner | Facts | Config File | Load ETH set_fact: - wallet_eth: "{{ lookup('ini', 'eth, file={{wallet_file_local}}') }}" - when: wallet_file_local is file - ignore_errors: yes -- name: Miner | Facts | Config File | Load ETH - set_fact: - wallet_eth: "{{ lookup('ini', 'eth, section=null, file={{wallet_file_local}}') }}" - when: wallet_file_local is file - ignore_errors: yes -- name: Miner | Facts | Config File | Load ETH - set_fact: - wallet_eth: "{{ lookup('ini', 'eth, section=wallet, file={{wallet_file_local}}') }}" - when: wallet_file_local is file - ignore_errors: yes -- name: Miner | Facts | Config File | Load ETH - set_fact: - wallet_eth: "{{ lookup('ini', 'eth, section=global, file={{wallet_file_local}}') }}" - when: wallet_file_local is file - ignore_errors: yes + wallet_eth: "{{ lookup('ini', 'eth section={{config_section_wallet}} file={{config_file_local}}') }}" ## Verify ##