Skip to content

Commit a5b4827

Browse files
fix: copy json key files to remote servers (#149)
1 parent 043b42d commit a5b4827

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

ansible/playbooks/copy-genesis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,9 @@
157157
vars:
158158
_av: "{{ lookup('file', genesis_dir + '/annotated_validators.yaml') | from_yaml }}"
159159
_assignments: "{{ _av[inventory_hostname] | default([]) }}"
160-
_sk_files: "{{ _assignments | map(attribute='privkey_file') | list }}"
161-
_pk_files: "{{ _sk_files | map('regex_replace', '_sk\\.ssz$', '_pk.ssz') | list }}"
160+
_base: "{{ _assignments | map(attribute='privkey_file') | map('regex_replace', '_sk\\.ssz$', '') | list }}"
162161
set_fact:
163-
node_hash_sig_files: "{{ _sk_files + _pk_files }}"
162+
node_hash_sig_files: "{{ _base | product(['_sk.ssz', '_pk.ssz', '_sk.json', '_pk.json']) | map('join') | list }}"
164163
when: hash_sig_keys_stat.stat.exists
165164

166165
- name: Create hash-sig-keys directory on remote

ansible/playbooks/deploy-nodes.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,9 @@
172172
vars:
173173
_av: "{{ lookup('file', local_genesis_dir + '/annotated_validators.yaml') | from_yaml }}"
174174
_assignments: "{{ _av[node_name] | default([]) }}"
175-
_sk_files: "{{ _assignments | map(attribute='privkey_file') | list }}"
176-
_pk_files: "{{ _sk_files | map('regex_replace', '_sk\\.ssz$', '_pk.ssz') | list }}"
175+
_base: "{{ _assignments | map(attribute='privkey_file') | map('regex_replace', '_sk\\.ssz$', '') | list }}"
177176
set_fact:
178-
node_hash_sig_files: "{{ _sk_files + _pk_files }}"
177+
node_hash_sig_files: "{{ _base | product(['_sk.ssz', '_pk.ssz', '_sk.json', '_pk.json']) | map('join') | list }}"
179178
when: hash_sig_keys_local.stat.exists
180179
tags:
181180
- deploy

0 commit comments

Comments
 (0)