ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.05k stars 3.42k forks source link

Telegram notifications from AWX #8317

Open amg-web opened 4 years ago

amg-web commented 4 years ago

Now available in AWX 15.0: email, Grafana, IRC, Mettermost, Pagerduty, Rocket.chat, Slack, Twilio, webhook

Colonizator1 commented 1 year ago

You can easily use the webhook type. Example:

souovan commented 1 year ago

You can easily use the webhook type. Example:

* target url: `https://api.telegram.org/botYOUR_BOT_ID/sendMessage`

* HTTP Headers: `{ "Content-Type": "application/json" }`

* HTTP Method: POST

* Customize messages… **turn on**

* Success message body (or start/error):
{
    "chat_id": "YOUR_CHAT_ID",
    "text": "success - \"{{ job_friendly_name }}\""
}

Hi @Colonizator1 does this still work ? i've tried without success

Colonizator1 commented 1 year ago

@souovan Hi, we are using such telegram notifications right now. Any errors? Did you check your request manually, with postman, for example?

souovan commented 1 year ago

Is there a way to debbug this on AWX ? i only got this when i test the notification image

Colonizator1 commented 1 year ago

If you are sure that your request URL and data are correct, try to attache notification to some simple template. I guess you tried to test the notification with the Test button. I failed with it too. But it works well for templates.

souovan commented 1 year ago

Yeah, i've tried with the Test button, i will try attaching on some template.

LeoSpyke commented 1 year ago

Any news on this?

Colonizator1 commented 1 year ago

@LeoSpyke it's working as webhook type, read my message above

amg-web commented 1 year ago

it works strange I can not edit text message, it does not save it.

LeoSpyke commented 1 year ago

@LeoSpyke it's working as webhook type, read my message above

Yes I've seen your message, but I mean that this is not an integration, rather it is a "collateral" workaround that works. Another native approach would allow to write the token in a specific password field, like the Token for Twilio or Pagerduty, rather than in plain text in the Target URL field.

igorferrati commented 1 month ago

Maybe this issue can help you:

webhook notification body is not valid anymore