From d0bd08decc1ada26b3e77ffb246c64a2925d1322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 3 Jun 2020 16:10:14 +0200 Subject: [PATCH] fix loading account JSON if not specified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- tasks/generate.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tasks/generate.yml b/tasks/generate.yml index c0a8826..a8afc87 100644 --- a/tasks/generate.yml +++ b/tasks/generate.yml @@ -69,15 +69,17 @@ group: docker state: link - - name: Geth | Save account address - slurp: - src: '{{ geth_account_json_file }}' - register: geth_account +- name: Geth | Save account address + slurp: + src: '{{ geth_account_json_file }}' + when: geth_account_json is not defined + register: geth_account + +- name: Geth | Extract account JSON + set_fact: + geth_account_json: '{{ (geth_account.content | b64decode | from_json) }}' + when: geth_account_json is not defined - - name: Geth | Extract account JSON - set_fact: - geth_account_json: '{{ (geth_account.content | b64decode | from_json) }}' - - name: Geth | Extract account address set_fact: geth_account_addr: '{{ geth_account_json["address"] }}'