Add uptime kuma
This commit is contained in:
		
							parent
							
								
									9fd25952a8
								
							
						
					
					
						commit
						47f90af3d6
					
				
					 8 changed files with 37 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -10,5 +10,6 @@ mailer:
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
services_path: /opt/services/
 | 
			
		||||
caddy_config_path: "{{ (services_path, 'caddy', 'config', 'conf.d') | path_join }}"
 | 
			
		||||
caddy_path: "{{ (services_path, 'caddy') | path_join }}"
 | 
			
		||||
caddy_config_path: "{{ (caddy_path, 'config', 'conf.d') | path_join }}"
 | 
			
		||||
managed_sites: []
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,5 +9,6 @@
 | 
			
		|||
    - homebox
 | 
			
		||||
    - influxdb
 | 
			
		||||
    - umami
 | 
			
		||||
    - uptime-kuma
 | 
			
		||||
    - watchtower
 | 
			
		||||
    - wiki-js
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										7
									
								
								_ansible/roles/uptime-kuma/tasks/main.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								_ansible/roles/uptime-kuma/tasks/main.yml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
---
 | 
			
		||||
- name: Deploy {{ svc.name }}
 | 
			
		||||
  tags:
 | 
			
		||||
    - uptime-kuma
 | 
			
		||||
    - status
 | 
			
		||||
  block:
 | 
			
		||||
    - import_tasks: deploy-common-service.yml
 | 
			
		||||
							
								
								
									
										14
									
								
								_ansible/roles/uptime-kuma/vars/main.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								_ansible/roles/uptime-kuma/vars/main.yml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
svc:
 | 
			
		||||
  domain: "status.serguzim.me"
 | 
			
		||||
  name: uptime-kuma
 | 
			
		||||
  port: 3001
 | 
			
		||||
 | 
			
		||||
compose:
 | 
			
		||||
  watchtower: true
 | 
			
		||||
  image: louislam/uptime-kuma:1
 | 
			
		||||
  volumes:
 | 
			
		||||
    - data:/app/data
 | 
			
		||||
  file:
 | 
			
		||||
    volumes:
 | 
			
		||||
      data:
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
- import_tasks: steps/create-service-directory.yml
 | 
			
		||||
- import_tasks: steps/template-docker-compose.yml
 | 
			
		||||
- import_tasks: steps/template-service-env.yml
 | 
			
		||||
  when: compose.env|default(False) == True
 | 
			
		||||
- include_tasks: steps/template-site-config.yml
 | 
			
		||||
  when: svc.domain is defined
 | 
			
		||||
- import_tasks: steps/start-service.yml
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,3 +7,9 @@
 | 
			
		|||
- name: Register caddy site
 | 
			
		||||
  ansible.builtin.set_fact:
 | 
			
		||||
    managed_sites: "{{ managed_sites + [svc.domain + '.conf'] }}"
 | 
			
		||||
 | 
			
		||||
- name: Reload caddy
 | 
			
		||||
  ansible.builtin.command:
 | 
			
		||||
    cmd: docker compose exec app sh -c "caddy validate --config /etc/caddy/Caddyfile && caddy reload --config /etc/caddy/Caddyfile"
 | 
			
		||||
    chdir: "{{ caddy_path }}"
 | 
			
		||||
  changed_when: True
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue