Refactor playbook.yml to improve contract deployment and execution handling. Added asynchronous execution with polling for contract deployment and call commands, ensuring successful completion checks. Updated shell command execution to use /bin/bash for consistency.

This commit is contained in:
vvzvlad 2025-01-19 19:29:37 +03:00
parent 04efc25a48
commit b006ea31b0

View File

@ -242,9 +242,13 @@
register: contract_deploy_output
args:
chdir: "{{ ansible_env.HOME }}/node"
executable: /bin/bash
retries: 5
delay: 120
failed_when: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" not in contract_deploy_output.stdout'
async: 120
poll: 30
until: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" in contract_deploy_output.stdout'
failed_when: false
- name: Update CallContract.s.sol with contract address
ansible.builtin.shell: bash update_contracts.sh
@ -256,9 +260,13 @@
register: contract_call_output
args:
chdir: "{{ ansible_env.HOME }}/node"
executable: /bin/bash
retries: 5
delay: 120
failed_when: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" not in contract_call_output.stdout'
async: 120
poll: 30
until: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" in contract_call_output.stdout'
failed_when: false
# - name: Set Docker containers to restart unless stopped
# ansible.builtin.shell: |