-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.yml
102 lines (94 loc) · 3.87 KB
/
config.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
- name: Create RocketPool root settings dir
file:
path: '{{ item }}'
owner: '{{ rocketpool_user }}'
group: '{{ rocketpool_group }}'
state: 'directory'
mode: 0755
with_items:
- '{{ rocketpool_service_path }}'
- '{{ rocketpool_data_path }}'
- '{{ rocketpool_records_path }}'
- '{{ rocketpool_validators_path }}'
- name: Save checksum of config file before
register: rocketpool_config_before
stat:
path: '{{ rocketpool_service_path }}/user-settings.yml'
# The user-settings.yml.j2 template was created based on the config created
# by running this command during initial setup. Unnecessary unless upgrading.
- name: Generate Rocketpool node config
become_user: '{{ rocketpool_user }}'
register: wtf
command: |
/usr/local/bin/rocketpool-cli \
--allow-root
--config-path={{ rocketpool_service_path }} \
service config \
--enableMetrics=true \
--enableODaoMetrics=true \
--nodeMetricsPort={{ rocketpool_metrics_port }} \
--watchtowerMetricsPort={{ rocketpool_watchtower_metrics_port }} \
--bnMetricsPort={{ rocketpool_eth2_metrics_port }} \
--smartnode-network=mainnet \
--smartnode-archiveECUrl={{ rocketpool_eth1_archive_url | mandatory }} \
--smartnode-dataPath={{ rocketpool_data_path }} \
--smartnode-autoInitVPThreshold={{ rocketpool_voting_power_threshold }} \
--executionClientMode=external \
--executionClient=geth \
--externalExecution-httpUrl={{ rocketpool_eth1_exec_layer_rpc_url | mandatory }} \
--externalExecution-wsUrl={{ rocketpool_eth1_exec_layer_ws_url | mandatory }} \
--executionCommon-enginePort={{ rocketpool_eth2_engine_port }} \
--executionCommon-suggestedBlockGasLimit={{ rocketpool_exec_layer_block_gas_limit }} \
--useFallbackClients=true \
--fallbackNormal-ecHttpUrl={{ rocketpool_fallback_eth1_rpc_url }} \
--fallbackNormal-ccHttpUrl={{ rocketpool_fallback_eth2_api_url }} \
--consensusClientMode=external \
--consensusClient=nimbus \
--consensusCommon-apiPort={{ rocketpool_eth2_rest_port }} \
--consensusCommon-graffiti={{ rocketpool_graffiti }} \
--consensusCommon-p2pPort={{ rocketpool_eth2_libp2p_port }} \
--consensusCommon-suggestedBlockGasLimit={{ rocketpool_consensus_layer_block_gas_limit }} \
--native-ecHttpUrl={{ rocketpool_eth1_exec_layer_rpc_url | mandatory }} \
--native-consensusClient=nimbus \
--native-ccHttpUrl=http://localhost:{{ rocketpool_eth2_rest_port }} \
--native-validatorRestartCommand={{ rocketpool_service_path }}/eth2-restart.sh \
--native-validatorStopCommand={{ rocketpool_service_path }}/eth2-stop.sh
- name: Ensure native mode is enabled
lineinfile:
path: '{{ rocketpool_service_path }}/user-settings.yml'
regexp: '^ isNative: ".*"'
line: ' isNative: "true"'
- name: Save checksum of config file after
register: rocketpool_config_after
stat:
path: '{{ rocketpool_service_path }}/user-settings.yml'
- name: Check if config file changed
set_fact:
rocketpool_config_changed: |
'{{ not rocketpool_config_before.stat.exists or
(rocketpool_config_before.stat.checksum != rocketpool_config_after.stat.checksum) }}'
- name: Create wrapper scripts
template:
src: 'scripts/{{ item }}.j2'
dest: '{{ rocketpool_service_path }}/{{ item }}'
owner: '{{ rocketpool_user }}'
mode: 0755
with_items:
- 'cli.sh'
- 'eth2-stop.sh'
- 'eth2-restart.sh'
- name: Create RocketPool password file
copy:
dest: '{{ rocketpool_password_file }}'
owner: '{{ rocketpool_user }}'
group: '{{ rocketpool_group }}'
mode: 0400
content: '{{ rocketpool_password | mandatory }}'
- name: Create RocketPool wallet file
copy:
dest: '{{ rocketpool_wallet_file }}'
owner: '{{ rocketpool_user }}'
group: '{{ rocketpool_group }}'
mode: 0400
content: '{{ rocketpool_wallet | mandatory }}'