Compare commits

...
2 Commits
Author SHA1 Message Date
ashish 8a76bddbf1 Added ntfy router to ansible scripts 2023-11-19 05:12:40 -06:00
ashish 7b51846e1b Fixed inconsistent variable names bug 2023-11-19 05:12:14 -06:00
3 changed files with 28 additions and 2 deletions

No files matched your search

+24
View File
@@ -39,6 +39,30 @@
path: '{{docker_build_dir.path}}' path: '{{docker_build_dir.path}}'
state: absent state: absent
- name: Create temporary Docker build directory for broadcast-ntfy-router
ansible.builtin.tempfile:
state: directory
register: docker_build_dir
- name: Copy Docker build directory
ansible.builtin.copy:
src: ntfy_router/
dest: '{{docker_build_dir.path}}'
mode: preserve
- name: Build broadcast-ntfy-router Docker image
ansible.builtin.docker_image:
build:
path: '{{docker_build_dir.path}}'
name: broadcast-ntfy-router
tag: latest
source: build
force_source: true
state: present
- name: Remove temporary Docker build directory
become: true
ansible.builtin.file:
path: '{{docker_build_dir.path}}'
state: absent
- name: Read homelab config - name: Read homelab config
ansible.builtin.slurp: ansible.builtin.slurp:
src: '{{ansible_user_dir}}/.homelab.json' src: '{{ansible_user_dir}}/.homelab.json'
+2 -2
View File
@@ -45,10 +45,10 @@ class NtfyRouter:
def route_message(self, topic: str, title: str, message: str): def route_message(self, topic: str, title: str, message: str):
if topic in self._formatters['notification']: if topic in self._formatters['notification']:
notification_args = {notification_arg: self._formatters['notification'][topic][output](topic=topic, title=title, message=message) for notification_arg in self._formatters['notification'][topic]} notification_args = {notification_arg: self._formatters['notification'][topic][call_arg](topic=topic, title=title, message=message) for notification_arg in self._formatters['notification'][topic]}
self._send_notification(user='ashish', priority='high', **notification_args) self._send_notification(user='ashish', priority='high', **notification_args)
elif topic in self._call_topics: elif topic in self._call_topics:
call_args = {call_arg: self._formatters['call'][topic][output](topic=topic, title=title, message=message) for call_arg in self._formatters['call'][topic]} call_args = {call_arg: self._formatters['call'][topic][call_arg](topic=topic, title=title, message=message) for call_arg in self._formatters['call'][topic]}
self._send_call(user='ashish', **call_args) self._send_call(user='ashish', **call_args)
async def start(self, rabbitmq_host: str, rabbitmq_port: int): async def start(self, rabbitmq_host: str, rabbitmq_port: int):
+2
View File
@@ -12,6 +12,8 @@
mode: preserve mode: preserve
- name: Docker Compose down Broadcast - name: Docker Compose down Broadcast
environment:
SERVER_IP: '{{ansible_default_ipv4.address}}'
community.docker.docker_compose: community.docker.docker_compose:
project_name: broadcast project_name: broadcast
project_src: '{{docker_compose_dir.path}}' project_src: '{{docker_compose_dir.path}}'