On this page
telegram - module for sending notifications via telegram
New in version 2.2.
Synopsis
- Send notifications via telegram bot, to a verified group or user
Options
parameter | required | default | choices | comments |
---|---|---|---|---|
chat_id |
yes |
Telegram group or user chat_id
|
||
msg |
yes |
What message you wish to send.
|
||
msg_format
(added in 2.4)
|
no | plain |
|
Message format. Formatting options `markdown` and `html` described in Telegram API docs (https://core.telegram.org/bots/api#formatting-options). If option `plain` set, message will not be formatted.
|
token |
yes |
Token identifying your telegram bot.
|
Examples
- name: send a message to chat in playbook
telegram:
token: '9999999:XXXXXXXXXXXXXXXXXXXXXXX'
chat_id: 000000
msg: Ansible task finished
Return Values
Common return values are documented here Return Values, the following are the fields unique to this module:
name | description | returned | type | sample |
---|---|---|---|---|
msg |
The message you attempted to send
|
success | string | Ansible task finished |
telegram_error |
Error message gotten from Telegram API
|
failure | string | Bad Request: message text is empty |
Notes
Note
- You will require a telegram account and create telegram bot to use this module.
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/telegram_module.html