Skip to content

Commit c080f7e

Browse files
committed
[infra] fix destory workfllow
1 parent 7887582 commit c080f7e

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/destroy-devnet.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ jobs:
190190
echo ""
191191
192192
- name: Destroy devnet
193+
env:
194+
TF_IN_AUTOMATION: "true"
195+
TF_CLI_ARGS_destroy: "-auto-approve"
193196
run: |
194197
chmod +x ./bin/destroy
195198
./bin/destroy "$NETWORK_NAME" -t="$DESTROY_TARGET"

ansible/roles/dashd/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ dashd_allowprivatenet: '{% if dashd_externalip | ansible.utils.ipaddr("private")
1616

1717
dashd_compose_project_name: dashcore
1818
dashd_compose_path: '{{ dashd_home }}/{{ dashd_compose_project_name }}'
19+
20+
# Wallet operations are only enabled on dedicated wallet nodes.
21+
enable_wallet: false

ansible/roles/dashd/tasks/main.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
block: |
102102
wallet={{ wallet_rpc_wallet_faucet }}
103103
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
105105

106106
# TODO: why does this always take exactly 30 seconds on first deploy?
107107
- name: Start dash core
@@ -126,14 +126,14 @@
126126
cmd: dash-cli createwallet {{ wallet_rpc_wallet_faucet }}
127127
creates: "{{ dashd_home }}/.dashcore/{{ dash_network_name if dash_network == 'devnet' else 'testnet3' }}/wallets/{{ wallet_rpc_wallet_faucet }}/wallet.dat"
128128
register: create_faucet_wallet_result
129-
when: enable_wallet is true
129+
when: enable_wallet | default(false) | bool
130130

131131
- name: Create mno wallet
132132
ansible.builtin.command:
133133
cmd: dash-cli createwallet {{ wallet_rpc_wallet_mno }}
134134
creates: "{{ dashd_home }}/.dashcore/{{ dash_network_name if dash_network == 'devnet' else 'testnet3' }}/wallets/{{ wallet_rpc_wallet_mno }}/wallet.dat"
135135
register: create_mno_wallet_result
136-
when: enable_wallet is true
136+
when: enable_wallet | default(false) | bool
137137

138138
- name: Load wallets on startup
139139
ansible.builtin.blockinfile:
@@ -142,10 +142,13 @@
142142
block: |
143143
wallet={{ wallet_rpc_wallet_faucet }}
144144
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)
146149
147150
- name: Import faucet privkey
148151
ansible.builtin.command: dash-cli -rpcwallet={{ wallet_rpc_wallet_faucet }} importprivkey {{ faucet_privkey }}
149152
register: result
150-
when: enable_wallet is true
153+
when: enable_wallet | default(false) | bool
151154
changed_when: result.rc == 0

0 commit comments

Comments
 (0)