Minimize cloud-init config

This commit is contained in:
2024-07-02 17:32:35 +02:00
parent f05fac48ca
commit e08969bee5
4 changed files with 64 additions and 3 deletions

View File

@@ -0,0 +1,56 @@
#cloud-config
groups:
- ubuntu: [root,sys]
- docker
- bot
users:
- default
- name: keeper
gecos: keeper
shell: /bin/bash
primary_group: bot
sudo: ALL=(ALL) NOPASSWD:ALL
groups: users, admin, docker
lock_passwd: false
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- chrony
- docker.io
- docker-compose
ntp:
enabled: true
ntp_client: chrony
servers:
- ${ntp_server}
runcmd:
- systemctl stop snapd && systemctl disable snapd
- git clone https://github.com/0x1d/drift-keeper /app/bot
- cp -rT /transfer /app/bot && rm -rf /transfer
- chown -R keeper:bot /app/bot
- cd /app/bot && sudo -u keeper -g bot -- docker-compose up -d
write_files:
- path: /transfer/.env
encoding: b64
owner: root:root
permissions: '0750'
content: ${env_file}
- path: /transfer/config.yaml
encoding: b64
owner: root:root
permissions: '0750'
content: ${config_file}
- path: /transfer/docker-compose.yaml
encoding: b64
owner: root:root
permissions: '0750'
content: ${docker_compose_file}

View File

@@ -32,7 +32,7 @@ ntp:
runcmd:
- systemctl stop snapd && systemctl disable snapd
- git clone -b feature/scaling https://github.com/0x1d/drift-keeper /app/bot
- git clone https://github.com/0x1d/drift-keeper /app/bot
- cp -rT /transfer /app/bot && rm -rf /transfer
- chown -R keeper:bot /app/bot
- cd /app/bot && sudo -u keeper -g bot -- docker-compose up -d