-
Notifications
You must be signed in to change notification settings - Fork 0
/
polygon-node-cloud-init.yml
42 lines (41 loc) · 1.21 KB
/
polygon-node-cloud-init.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
#cloud-config
package_update: true
package_upgrade: true
users:
- name: ${prefix}
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
groups: sudo, docker
shell: /bin/bash
ssh_authorized_keys:
- "${ssh_key_1}"
- "${ssh_key_2}"
packages:
- fail2ban
- docker.io
- iptables-persistent
- jq
- prometheus-node-exporter
- python3-pip
preserve_hostname: false
fqdn: ${fqdn}
hostname: ${fqdn}
write_files:
- path: /etc/environment
content: |
FQDN="${fqdn}"
DATA_VOLUME="/mnt/${data_volume_name}"
POLYGON_NETWORK_NAME="${polygon_network_name}"
POLYGON_NETWORK_CODE="${polygon_network_code}"
BOR_MODE="${bor_mode}"
ETH_RPC_URL="${eth_rpc_url}"
HEIMDALL_SEEDS="${heimdall_seeds}"
BOR_BOOTNODES="${bor_bootnodes}"
CADDY_USER="${caddy_user}"
CADDY_PASSWORD='${caddy_password}'
NODE_USER="${prefix}"
append: true
runcmd:
- pip3 install docker-compose
- sed -i -e '/^Port/s/^.*$/Port ${ssh_port}/' /etc/ssh/sshd_config
- sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config
- sed -i -e '$aAllowUsers ${prefix}' /etc/ssh/sshd_config