From a269c3e490a9e02c9c4370e5d7f2f2bbb2bbff8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 22 Feb 2021 15:49:05 +0100 Subject: [PATCH] distribute-validators: add --delete for rsyncing secrets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also drop some debug messages, comment out ignore_errors. Signed-off-by: Jakub SokoĊ‚owski --- ansible/roles/distribute-validators/tasks/check.yml | 6 ------ ansible/roles/distribute-validators/tasks/write.yml | 7 +++---- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/ansible/roles/distribute-validators/tasks/check.yml b/ansible/roles/distribute-validators/tasks/check.yml index 36c2e0b..7f97742 100644 --- a/ansible/roles/distribute-validators/tasks/check.yml +++ b/ansible/roles/distribute-validators/tasks/check.yml @@ -14,17 +14,11 @@ that: '{{ (new_validators|intersect(new_secrets)|length) == (new_validators|length) }}' fail_msg: 'List of validators and their secrets does not overlap!' -- debug: var=new_validators[0:10] -- debug: var=old_validators[0:10] - - name: Check compare existing validators set_fact: secrets_diff: '{{ new_secrets|difference(old_secrets) }}' validators_diff: '{{ new_validators|difference(old_validators) }}' -- debug: var=secrets_diff[0:10] -- debug: var=validators_diff[0:10] - - name: Check if validators changed set_fact: secrets_changed: '{{ secrets_diff|length > 0 }}' diff --git a/ansible/roles/distribute-validators/tasks/write.yml b/ansible/roles/distribute-validators/tasks/write.yml index 8881759..1ea4320 100644 --- a/ansible/roles/distribute-validators/tasks/write.yml +++ b/ansible/roles/distribute-validators/tasks/write.yml @@ -3,7 +3,7 @@ command: docker-compose stop args: chdir: '/docker/{{ dist_validators_cont_name }}' - ignore_errors: true + #ignore_errors: true - name: Remove validators/secrets folders file: @@ -33,8 +33,7 @@ - name: Copy over secrets command: | - rsync -ru \ - {{ new_secrets | join(" ") }} '{{ dist_validators_data_path }}/secrets/' + rsync -ru --delete {{ new_secrets | join(" ") }} '{{ dist_validators_data_path }}/secrets/' args: chdir: '{{ dist_validators_secrets_path }}' @@ -58,4 +57,4 @@ command: docker-compose start args: chdir: '/docker/{{ dist_validators_cont_name }}' - ignore_errors: true + #ignore_errors: true