community.general.pushbullet 模块 – 向 Pushbullet 发送通知
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。您需要其他要求才能使用此模块,有关详细信息,请参阅 要求。
要在 playbook 中使用它,请指定:community.general.pushbullet
。
概要
此模块通过 Pushbullet 向频道或设备发送推送通知。
要求
执行此模块的主机需要以下要求。
pushbullet.py
参数
参数 |
注释 |
---|---|
Pushbullet API 令牌 |
|
通知正文,例如您正在警报的故障详细信息。 |
|
您希望广播推送通知的频道标签,如 Pushbullet 页面上的“我的频道”>“编辑您的频道”所示。 |
|
您希望发送推送通知的设备名称,如 Pushbullet 主页所示。 |
|
您希望推送的内容。 选项
|
|
通知标题。 |
|
URL 字段,在 |
属性
属性 |
支持 |
描述 |
---|---|---|
支持:完全支持 |
可以在 |
|
支持:不支持 |
处于 diff 模式时,将返回有关已更改内容(或可能需要在 |
备注
注意
远程主机需要 pushbullet.py Python 包。您可以使用 pip 安装它($ pip install pushbullet.py)。请参阅 https://github.com/randomchars/pushbullet.py
示例
- name: Sends a push notification to a device
community.general.pushbullet:
api_key: "ABC123abc123ABC123abc123ABC123ab"
device: "Chrome"
title: "You may see this on Google Chrome"
- name: Sends a link to a device
community.general.pushbullet:
api_key: ABC123abc123ABC123abc123ABC123ab
device: Chrome
push_type: link
title: Ansible Documentation
body: https://docs.ansible.org.cn/
- name: Sends a push notification to a channel
community.general.pushbullet:
api_key: ABC123abc123ABC123abc123ABC123ab
channel: my-awesome-channel
title: Broadcasting a message to the #my-awesome-channel folks
- name: Sends a push notification with title and body to a channel
community.general.pushbullet:
api_key: ABC123abc123ABC123abc123ABC123ab
channel: my-awesome-channel
title: ALERT! Signup service is down
body: Error rate on signup service is over 90% for more than 2 minutes