|
101 | 101 | block: | |
102 | 102 | wallet={{ wallet_rpc_wallet_faucet }} |
103 | 103 | wallet={{ wallet_rpc_wallet_mno }} |
104 | | - when: enable_wallet is true and wallet_exists.stat.exists is true |
| 104 | + when: (enable_wallet | default(false) | bool) and wallet_exists.stat.exists is true |
105 | 105 |
|
106 | 106 | # TODO: why does this always take exactly 30 seconds on first deploy? |
107 | 107 | - name: Start dash core |
|
126 | 126 | cmd: dash-cli createwallet {{ wallet_rpc_wallet_faucet }} |
127 | 127 | creates: "{{ dashd_home }}/.dashcore/{{ dash_network_name if dash_network == 'devnet' else 'testnet3' }}/wallets/{{ wallet_rpc_wallet_faucet }}/wallet.dat" |
128 | 128 | register: create_faucet_wallet_result |
129 | | - when: enable_wallet is true |
| 129 | + when: enable_wallet | default(false) | bool |
130 | 130 |
|
131 | 131 | - name: Create mno wallet |
132 | 132 | ansible.builtin.command: |
133 | 133 | cmd: dash-cli createwallet {{ wallet_rpc_wallet_mno }} |
134 | 134 | creates: "{{ dashd_home }}/.dashcore/{{ dash_network_name if dash_network == 'devnet' else 'testnet3' }}/wallets/{{ wallet_rpc_wallet_mno }}/wallet.dat" |
135 | 135 | register: create_mno_wallet_result |
136 | | - when: enable_wallet is true |
| 136 | + when: enable_wallet | default(false) | bool |
137 | 137 |
|
138 | 138 | - name: Load wallets on startup |
139 | 139 | ansible.builtin.blockinfile: |
|
142 | 142 | block: | |
143 | 143 | wallet={{ wallet_rpc_wallet_faucet }} |
144 | 144 | wallet={{ wallet_rpc_wallet_mno }} |
145 | | - when: create_faucet_wallet_result.changed and create_mno_wallet_result.changed |
| 145 | + when: > |
| 146 | + (enable_wallet | default(false) | bool) and |
| 147 | + (create_faucet_wallet_result is defined and create_faucet_wallet_result.changed) and |
| 148 | + (create_mno_wallet_result is defined and create_mno_wallet_result.changed) |
146 | 149 |
|
147 | 150 | - name: Import faucet privkey |
148 | 151 | ansible.builtin.command: dash-cli -rpcwallet={{ wallet_rpc_wallet_faucet }} importprivkey {{ faucet_privkey }} |
149 | 152 | register: result |
150 | | - when: enable_wallet is true |
| 153 | + when: enable_wallet | default(false) | bool |
151 | 154 | changed_when: result.rc == 0 |
0 commit comments