-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloud-init.yml
37 lines (36 loc) · 996 Bytes
/
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
#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}"
DO_TOKEN="${do_token}"
DATA_VOLUME="/mnt/${data_volume_name}"
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