feat: Add DropOSS

This commit is contained in:
Lino Silva
2025-08-06 09:44:02 +01:00
parent 82530f4248
commit 877b4581af
11 changed files with 193 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
---
ansible_user: root
ansible_host: 10.0.2.46
ansible_ssh_pass: "{{ proxmox_api_password }}"
vmid: 646
+1
View File
@@ -26,6 +26,7 @@ jellyfin
convertx
nocodb
super-productivity
droposs
[baremetal]
mipha
+27
View File
@@ -0,0 +1,27 @@
---
- hosts: localhost
become: yes
roles:
- role: 46-droposs/provision/delete
vars:
vmid: 646
- role: 46-droposs/provision/create
vars:
vmid: 646
- role: 46-droposs/provision/start
vars:
vmid: 646
- hosts: purah
become: yes
roles:
- role: 46-droposs/enable-ssh
vars:
vmid: 646
- hosts: droposs
become: yes
roles:
- role: 46-droposs/update
- role: 46-droposs/install-docker
- role: 46-droposs/install-app
@@ -0,0 +1,12 @@
---
# Unable to use ansible.builtin.lineinfile, because we need to run this through the proxmox host (because SSH is not enabled duh)
- name: Pause for 10 seconds to wait for SSH server
ansible.builtin.pause:
seconds: 10
- name: Allow SSH into LXC
ansible.builtin.command: lxc-attach -n 646 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
- name: Restart SSH Service
ansible.builtin.command: lxc-attach -n 646 service ssh restart
@@ -0,0 +1,20 @@
---
- name: Create directory for docker-compose
ansible.builtin.file:
path: /root/docker/
state: directory
mode: "0755"
- name: Copy docker-compose file
template:
src: "docker-compose.yml"
dest: /root/docker/docker-compose.yml
owner: root
group: root
mode: 0755
- name: Run docker-compose
ansible.builtin.shell:
args:
cmd: docker compose up -d
chdir: /root/docker/
@@ -0,0 +1,29 @@
services:
postgres:
image: postgres:14-alpine
ports:
- 5432:5432
healthcheck:
test: pg_isready -d drop -U drop
interval: 30s
timeout: 60s
retries: 5
start_period: 10s
volumes:
- ./db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=drop
- POSTGRES_USER=drop
- POSTGRES_DB=drop
drop:
image: ghcr.io/drop-oss/drop:latest
depends_on:
postgres:
condition: service_healthy
ports:
- 3000:3000
volumes:
- ./data:/data
environment:
- DATABASE_URL=postgres://drop:drop@postgres:5432/drop
- EXTERNAL_URL=https://games.lino.cooking
@@ -0,0 +1,27 @@
---
- name: Get convenience script
uri:
url: "https://get.docker.com"
method: GET
dest: /tmp/get-docker.sh
mode: a+x
creates: /tmp/get-docker.sh
- name: Execute script
ansible.builtin.shell: /tmp/get-docker.sh
- name: Ensure group "docker" exists
ansible.builtin.group:
name: docker
state: present
- name: Add root user to docker group
ansible.builtin.user:
name: root
groups: docker
append: yes
- name: Enable docker on startup
ansible.builtin.shell: |
systemctl enable docker.service
systemctl enable containerd.service
@@ -0,0 +1,30 @@
---
- name: Create container
community.general.proxmox:
vmid: 646
node: purah
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
password: "{{ lxc_password }}"
hostname: droposs
ostemplate: "local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst"
netif: "{'net0':'name=eth0,\
gw=10.0.0.1,\
ip=10.0.2.46/21,\
hwaddr=cc:c6:cf:de:20:46,\
bridge=vmbr0'}"
cores: 2
memory: 4196
unprivileged: no
swap: 0
searchdomain: "home"
onboot: 1
features:
- nesting=1
- keyctl=1
disk: purah-mirror-860gb:30
mounts: '{
"mp0":"purah-mirror-860gb:10,mp=/data,backup=1"
}'
force: yes
@@ -0,0 +1,27 @@
---
- name: Stop container
community.general.proxmox:
vmid: "{{ vmid }}"
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
state: stopped
ignore_errors: true
timeout: 90
- name: Remove containers
community.general.proxmox:
vmid: "{{ vmid }}"
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
state: absent
ignore_errors: true
timeout: 90
- name: Remove .ssh/known_hosts lines
ansible.builtin.lineinfile:
path: /Users/lino.silva/.ssh/known_hosts
state: absent
regexp: "^10.0.2.46"
@@ -0,0 +1,8 @@
---
- name: Start deployments
community.general.proxmox:
vmid: "{{ vmid }}"
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
state: started
+6
View File
@@ -0,0 +1,6 @@
---
- name: Update all packages to their latest version
become: true
ansible.builtin.apt:
update_cache: yes
upgrade: full