Files
ansible-pull/roles/bastionhost/tasks/system_setup/ntfy_alerts.yml

22 lines
526 B
YAML

---
- name: system setup | ntfy alerts | install curl
tags: ntfy,hardening,system
package:
name: curl
state: present
- name: system setup | ntfy alerts | create ssh login alert script
tags: ntfy,hardening,system
copy:
dest: /etc/ssh/sshrc
owner: root
group: root
mode: '0755'
content: |
#!/bin/sh
# Managed by Ansible
# Send SSH login alert to ntfy topic.
MESSAGE="{{ ntfy_ssh_login_message }}"
curl -s -d "$MESSAGE" "{{ ntfy_url }}" > /dev/null