Skip to content

jpmens/ansible-ntfy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

nfty Ansible action plugin

nfty is an Ansible action plugin to post JSON messages to nfty and similar HTTP endpoints. The nfty server is open source.

nfty Web interface in action

Consider the following playbook which created the two notifications above:

- hosts: alice
  vars:
     topic: "admin-alerts"
  tasks:
    - name: "Notify ntfy that we're done (topic obtained from play var)"
      ntfy:
           msg: "deployment on {{ inventory_hostname }} is complete. 🐄 "

    - name: "different topic"
      ntfy:
            msg: "that's a wrap"
            topic: "admin-alerts"
            attrs:
               tags: [ rotating_light, heavy_check_mark ]
               priority: 4
               actions:
                  - action: view
                    label: "Open Mastodon"
                    url: "https://mastodon.social/@jpmens"