-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit-bootnodes.yaml
59 lines (48 loc) · 1.3 KB
/
init-bootnodes.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
- name: Create the list of bootnodes in enr format
hosts: sign
remote_user: app
vars:
ansible_remote_tmp: /tmp
tasks:
- name: copy genesis file on machine
copy:
src: genesis.json
dest: ~/dyneth/data
- name: Check genesis initialization
shell: test -r ~/dyneth/data/geth/chaindata/CURRENT && echo "GenesisInitialized" || echo
register: genesis_initialized
changed_when: false
- name: Initialize data/genesis.json
command: make genesis-init
args:
chdir: ~/dyneth
when: genesis_initialized.stdout != "GenesisInitialized"
- name: delete bootnodes.csv
file:
path: ~/dyneth/data/bootnodes.csv
state: absent
- name: Stop geth
command: make stop
ignore_errors: true
args:
chdir: ~/dyneth
- name: touch empty bootnodes.csv
file:
path: ~/dyneth/data/bootnodes.csv
state: touch
- name: Run signer in background
command: make run-signer
args:
chdir: ~/dyneth
- name: clean local enr files
local_action: command /bin/rm -f enr*
- pause:
seconds: 2
- name: Generate enode
command: make enode
register: enode
args:
chdir: ~/dyneth
- debug: var=enode.stdout
- local_action: copy content="{{ enode.stdout_lines.0 }}" dest="enode-{{ inventory_hostname }}"