From b006ea31b0bbcd66089c24850607ed0796d438db Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sun, 19 Jan 2025 19:29:37 +0300 Subject: [PATCH] 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. --- playbook.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/playbook.yml b/playbook.yml index 867f65d..9f6eb00 100644 --- a/playbook.yml +++ b/playbook.yml @@ -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: |