Files
configpolicy/roles/journal2ntfy/tasks/main.yml
Dustin C. Hatch a7319c561d journal2ntfy: Script to send log messagess via ntfy
The `journal2ntfy.py` script follows the systemd journal by spawning
`journalctl` as a child process and reading from its standard output
stream.  Any command-line arguments passed to `journal2ntfy` are passed
to `journalctl`, which allows the caller to specify message filters.
For any matching journal message, `journal2ntfy` sends a message via
the *ntfy* web service.

For the BURP server, we're going to use `journal2ntfy` to generate
alerts about the RAID array.  When I reconnect the disk that was in the
fireproof safe, the kernel will log a message from the *md* subsystem
indicating that the resynchronization process has begun.  Then, when
the disks are again in sync, it will log another message, which will
let me know it is safe to archive the other disk.
2023-05-17 14:51:21 -05:00

52 lines
972 B
YAML

- name: ensure journal2ntfy script is installed
copy:
src: journal2ntfy.py
dest: /usr/local/bin/journal2ntfy
owner: root
group: root
mode: u=rwx,go=rx
notify:
- restart journal2ntfy
tags:
- install
- name: ensure journal2ntfy.service systemd unit is installed
copy:
src: journal2ntfy.service
dest: /etc/systemd/system/journal2ntfy.service
owner: root
group: root
mode: u=rw,go=r
notify:
- restart journal2ntfy
tags:
- systemd
- name: ensure journal2ntfy is configured
template:
src: journal2ntfy.env.j2
dest: /etc/sysconfig/journal2ntfy
owner: root
group: root
mode: u=rw,go=r
notify:
- restart journal2ntfy
tags:
- config
- name: ensure journal2ntfy service is enabled
service:
name: journal2ntfy
enabled: true
tags:
- service
- meta: flush_handlers
- name: ensure journal2ntfy is running
service:
name: journal2ntfy
state: started
tags:
- service