thingies
This commit is contained in:
parent
5f06a966aa
commit
3343de2dc0
12 changed files with 286 additions and 57 deletions
51
ansible/services/uptime_kuma_playbook.yml
Normal file
51
ansible/services/uptime_kuma_playbook.yml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
- name: Deploy Uptime Kuma with Docker Compose and configure Caddy reverse proxy
|
||||
hosts: vipy
|
||||
become: yes
|
||||
vars:
|
||||
uptime_kuma_dir: /opt/uptime-kuma
|
||||
uptime_kuma_port: 3001
|
||||
caddy_sites_dir: /etc/caddy/sites-enabled
|
||||
uptime_kuma_domain: uptime.example.com # Change to your domain
|
||||
|
||||
tasks:
|
||||
- name: Create uptime kuma directory
|
||||
file:
|
||||
path: "{{ uptime_kuma_dir }}"
|
||||
state: directory
|
||||
owner: {{ ansible_user }}
|
||||
group: {{ ansible_user }}
|
||||
mode: '0755'
|
||||
|
||||
- name: Create docker-compose.yml for uptime kuma
|
||||
copy:
|
||||
dest: "{{ uptime_kuma_dir }}/docker-compose.yml"
|
||||
content: |
|
||||
version: "3"
|
||||
services:
|
||||
uptime-kuma:
|
||||
image: louislam/uptime-kuma:latest
|
||||
container_name: uptime-kuma
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "{{ uptime_kuma_port }}:3001"
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
|
||||
- name: Deploy uptime kuma container with docker compose
|
||||
command: docker-compose up -d
|
||||
args:
|
||||
chdir: "{{ uptime_kuma_dir }}"
|
||||
|
||||
- name: Create Caddy reverse proxy configuration for uptime kuma
|
||||
copy:
|
||||
dest: "{{ caddy_sites_dir }}/uptime-kuma.conf"
|
||||
content: |
|
||||
{{ uptime_kuma_domain }} {
|
||||
reverse_proxy localhost:{{ uptime_kuma_port }}
|
||||
}
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Reload Caddy to apply new config
|
||||
command: systemctl reload caddy
|
||||
Loading…
Add table
Add a link
Reference in a new issue