community / community.general / 6.6.8 / module / telegram Send notifications via telegram Authors: Artem Feofanov (@tyouxa), Nikolai Lomov (@lomserman)community.general.telegram (6.6.8) — module
Install with ansible-galaxy collection install community.general:==6.6.8
collections: - name: community.general version: 6.6.8
Send notifications via telegram bot, to a verified group or user.
Also, the user may try to use any other telegram bot API method, if you specify I(api_method) argument.
- name: Send notify to Telegram community.general.telegram: token: '9999999:XXXXXXXXXXXXXXXXXXXXXXX' api_args: chat_id: 000000 parse_mode: "markdown" text: "Your precious application has been deployed: https://example.com" disable_web_page_preview: true disable_notification: true
- name: Forward message to someone community.general.telegram: token: '9999999:XXXXXXXXXXXXXXXXXXXXXXX' api_method: forwardMessage api_args: chat_id: 000000 from_chat_id: 111111 disable_notification: true message_id: '{{ saved_msg_id }}'
token: description: - Token identifying your telegram bot. required: true type: str api_args: description: - Any parameters for the method. - For reference to default method, C(SendMessage), see U(https://core.telegram.org/bots/api#sendmessage). type: dict version_added: 2.0.0 version_added_collection: community.general api_method: default: SendMessage description: - Bot API method. - For reference, see U(https://core.telegram.org/bots/api). type: str version_added: 2.0.0 version_added_collection: community.general
msg: description: The message you attempted to send returned: success sample: Ansible task finished type: str telegram_error: description: Error message gotten from Telegram API returned: failure sample: 'Bad Request: message text is empty' type: str