Bangers only

This commit is contained in:
Javier Feliz 2025-07-04 02:46:10 -04:00
parent df070e3c93
commit 172d49be25
4 changed files with 84 additions and 1 deletions

View File

@ -14,4 +14,7 @@
port: 7072
- role: apps/erugo
vars:
port: 7073
port: 7073
- role: apps/tianji
vars:
port: 7074

View File

@ -0,0 +1,60 @@
---
- name: Install Tianji Reporter
hosts: vms:!apps # Tianji is already installed on apps node
become: true
vars:
server_url: "https://tianji.thegrind.dev"
workspace_id: "clnzoxcy10001vy2ohi4obbi0"
tasks:
- name: Ensure curl and wget are installed (Debian)
ansible.builtin.apt:
name:
- curl
- wget
update_cache: true
- name: Create install directory
ansible.builtin.file:
path: /usr/local/tianji/reporter
state: directory
mode: '0755'
- name: Check if Tianji reporter binary already exists
stat:
path: /usr/local/tianji/reporter/tianji-reporter
register: tianji_binary
- name: Download Tianji reporter binary
ansible.builtin.get_url:
url: "https://github.com/msgbyte/tianji/releases/latest/download/tianji-reporter-linux-amd64"
dest: /usr/local/tianji/reporter/tianji-reporter
mode: '0755'
when: not tianji_binary.stat.exists
- name: Create systemd service
ansible.builtin.copy:
dest: /usr/lib/systemd/system/tianji-reporter.service
content: |
[Unit]
Description=Tianji-Reporter
Documentation=https://github.com/msgbyte/tianji
After=network.target
[Service]
ExecStart=/usr/local/tianji/reporter/tianji-reporter --url "{{ server_url }}" --workspace "{{ workspace_id }}"
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target
mode: '0644'
- name: Reload systemd
ansible.builtin.systemd:
daemon_reload: true
- name: Enable and start Tianji reporter
ansible.builtin.systemd:
name: tianji-reporter
enabled: true
state: started

View File

View File

@ -0,0 +1,20 @@
- name: Create app DB
ansible.builtin.include_role:
name: app/database
vars:
app_name: tianji
- name: Create tianji container
community.docker.docker_container:
name: tianji
image: moonrailgun/tianji
pull: true
state: started
restart_policy: always
ports:
- "{{ port }}:12345"
env:
DATABASE_URL: postgresql://tianji:password@10.89.0.102:5432/tianji
JWT_SECRET: 7RpgjEwcb3lQOjT25sRXYg==
ALLOW_REGISTER: "false"
ALLOW_OPENAPI: "true"