- name: Deploy ntfy-emergency-app with Docker Compose and configure Caddy reverse proxy hosts: edge become: yes vars_files: - ./ntfy_emergency_app_vars.yml vars: ntfy_emergency_app_subdomain: "{{ subdomains.ntfy_emergency_app }}" ntfy_emergency_app_domain: "{{ ntfy_emergency_app_subdomain }}.{{ root_domain }}" # ⚠ UNRESOLVED: this app sends its notifications to an ntfy server, and the # server it points at ran on watchtower, which is being destroyed. This was # derived from subdomains.ntfy, which is now gone with it. # # Until an ntfy server exists again this URL is dead, and the app fails # silently at exactly the moment it matters - it is an EMERGENCY notifier. # Three ways out, none of them automatic: # * stand ntfy up somewhere else (the monitoring VPS, or vipy) # * point this at the public ntfy.sh # * retire the app ntfy_emergency_app_ntfy_url: "{{ ntfy_service_url }}" ntfy_emergency_app_ntfy_user: "{{ ntfy_username | default('') }}" ntfy_emergency_app_ntfy_password: "{{ ntfy_password | default('') }}" tasks: - name: Create ntfy-emergency-app directory file: path: "{{ ntfy_emergency_app_dir }}" state: directory owner: "{{ ansible_user }}" group: "{{ ansible_user }}" mode: '0755' - name: Create docker-compose.yml for ntfy-emergency-app copy: dest: "{{ ntfy_emergency_app_dir }}/docker-compose.yml" content: | version: "3" services: ntfy-emergency-app: image: ghcr.io/pmartincalvo/ntfy-emergency-app:latest container_name: ntfy-emergency-app restart: unless-stopped ports: - "{{ ntfy_emergency_app_port }}:3000" environment: NTFY_TOPIC: "{{ ntfy_emergency_app_topic }}" NTFY_URL: "{{ ntfy_emergency_app_ntfy_url }}" NTFY_USER: "{{ ntfy_emergency_app_ntfy_user }}" NTFY_PASSWORD: "{{ ntfy_emergency_app_ntfy_password }}" UI_MESSAGE: "{{ ntfy_emergency_app_ui_message }}" - name: Deploy ntfy-emergency-app container with docker compose command: docker compose up -d args: chdir: "{{ ntfy_emergency_app_dir }}" - name: Publish ntfy-emergency-app through Caddy ansible.builtin.include_role: name: caddy_site vars: caddy_site_name: ntfy-emergency-app caddy_site_domain: "{{ ntfy_emergency_app_domain }}" caddy_site_upstream: "localhost:{{ ntfy_emergency_app_port }}"