uptime kuma works
This commit is contained in:
parent
97ff4b40e3
commit
eddde5e53a
4 changed files with 26 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
- name: Secure Debian VPS
|
- name: Secure Debian VPS
|
||||||
hosts: vipy
|
hosts: vipy
|
||||||
vars_files:
|
vars_files:
|
||||||
- ../vars.yml
|
- ../infra_vars.yml
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
- name: Secure Debian VPS
|
- name: Secure Debian VPS
|
||||||
hosts: vipy
|
hosts: vipy
|
||||||
vars_files:
|
vars_files:
|
||||||
- ../vars.yml
|
- ../infra_vars.yml
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
new_user: counterweight
|
new_user: counterweight
|
||||||
ssh_port: 22
|
ssh_port: 22
|
||||||
allow_ssh_from: "any"
|
allow_ssh_from: "any"
|
||||||
|
root_domain: contrapeso.xyz
|
||||||
|
|
@ -1,19 +1,22 @@
|
||||||
- name: Deploy Uptime Kuma with Docker Compose and configure Caddy reverse proxy
|
- name: Deploy Uptime Kuma with Docker Compose and configure Caddy reverse proxy
|
||||||
hosts: vipy
|
hosts: vipy
|
||||||
become: yes
|
become: yes
|
||||||
|
vars_files:
|
||||||
|
- ../infra_vars.yml
|
||||||
vars:
|
vars:
|
||||||
uptime_kuma_dir: /opt/uptime-kuma
|
uptime_kuma_dir: /opt/uptime-kuma
|
||||||
uptime_kuma_port: 3001
|
uptime_kuma_port: 3001
|
||||||
caddy_sites_dir: /etc/caddy/sites-enabled
|
caddy_sites_dir: /etc/caddy/sites-enabled
|
||||||
uptime_kuma_domain: uptime.example.com # Change to your domain
|
subdomain: uptime
|
||||||
|
uptime_kuma_domain: "{{ subdomain }}.{{ root_domain }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Create uptime kuma directory
|
- name: Create uptime kuma directory
|
||||||
file:
|
file:
|
||||||
path: "{{ uptime_kuma_dir }}"
|
path: "{{ uptime_kuma_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: {{ ansible_user }}
|
owner: "{{ ansible_user }}"
|
||||||
group: {{ ansible_user }}
|
group: "{{ ansible_user }}"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Create docker-compose.yml for uptime kuma
|
- name: Create docker-compose.yml for uptime kuma
|
||||||
|
|
@ -32,10 +35,26 @@
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
|
|
||||||
- name: Deploy uptime kuma container with docker compose
|
- name: Deploy uptime kuma container with docker compose
|
||||||
command: docker-compose up -d
|
command: docker compose up -d
|
||||||
args:
|
args:
|
||||||
chdir: "{{ uptime_kuma_dir }}"
|
chdir: "{{ uptime_kuma_dir }}"
|
||||||
|
|
||||||
|
- name: Ensure Caddy sites-enabled directory exists
|
||||||
|
file:
|
||||||
|
path: /etc/caddy/sites-enabled
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Ensure Caddyfile includes import directive for sites-enabled
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/caddy/Caddyfile
|
||||||
|
line: 'import sites-enabled/*'
|
||||||
|
insertafter: EOF
|
||||||
|
state: present
|
||||||
|
backup: yes
|
||||||
|
|
||||||
- name: Create Caddy reverse proxy configuration for uptime kuma
|
- name: Create Caddy reverse proxy configuration for uptime kuma
|
||||||
copy:
|
copy:
|
||||||
dest: "{{ caddy_sites_dir }}/uptime-kuma.conf"
|
dest: "{{ caddy_sites_dir }}/uptime-kuma.conf"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue