AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,100 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example" published by Apress, and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

AAP 2.6 Notifications and Webhooks: Slack, Teams, Email, and Custom Integrations

By Luca Berton · Published 2024-01-01 · Category: troubleshooting

Configure AAP 2.6 notifications and webhooks for Slack, Microsoft Teams, email, PagerDuty, and custom endpoints. Job status alerts, workflow notifications, approval requests, and EDA-driven alerting.

Notifications in AAP 2.6

AAP notifications alert teams when jobs succeed, fail, or need approval. Every job template and workflow can trigger notifications to multiple channels simultaneously.

Notification Types

| Type | Use Case | |------|----------| | Email | Default alerting, compliance reports | | Slack | Real-time team notifications | | Microsoft Teams | Enterprise chat integration | | PagerDuty | On-call incident management | | Webhook | Custom integrations, ITSM tools | | IRC | Legacy chat systems | | Grafana | Annotation on dashboards | | Twilio | SMS alerts for critical failures | | Rocket.Chat | Self-hosted chat |

Email Notifications

Configure Email Backend

Create Email Notification Template

Slack Integration

Create Slack Notification

Microsoft Teams

Teams Webhook

PagerDuty

Custom Webhooks

Generic Webhook

Attach Notifications to Job Templates

Workflow Approval Notifications

Incoming Webhooks (Trigger Jobs)

AAP can also receive webhooks to trigger jobs:

GitHub webhook URL: https://gateway.example.org/api/controller/v2/job_templates//github/

Supported Webhook Sources

| Source | Service Key | Events | |--------|------------|--------| | GitHub | github | push, pull_request, release | | GitLab | gitlab | push, merge_request, tag_push | | BitBucket | bitbucket_dc | push, pull_request |

EDA-Driven Notifications

Use Event-Driven Ansible for real-time alerting:

FAQ

Can I customize notification messages per job status?

Yes. Each notification template supports separate message templates for started, success, and error states. Use Jinja2 templating with {{ job.* }} variables for dynamic content.

How do I test notifications without running a job?

Use the notification template test button in the AAP UI, or via API: POST /api/controller/v2/notification_templates//test/. This sends a test message to verify connectivity.

Can notifications include job output or logs?

Notification messages can reference job metadata (name, status, duration, host counts) but not the full stdout. For full logs, include a link to the job in AAP. For log forwarding, use the external logging integration (Splunk, ELK).

How do I handle notification failures?

Notification failures don't cause job failures — they're logged separately. Check Administration → Notifications for delivery status. For critical notifications, use multiple channels as redundancy.

Can I rate-limit notifications?

AAP doesn't have built-in rate limiting for notifications. Use your webhook endpoint or Slack/Teams channel settings to manage noise. For monitoring-triggered jobs, use EDA's debounce/throttle capabilities.

Conclusion

AAP 2.6's notification system integrates with every major communication and incident management platform. From Slack messages on job completion to PagerDuty alerts on failures to ServiceNow ticket creation — notifications keep teams informed and enable automated incident response workflows.

Related ArticlesAAP 2.6 Workflow Templates: Advanced Multi-Step Automation GuideAAP 2.6 Event-Driven Ansible and Kafka IntegrationAAP 2.6 Monitoring and Logging: Prometheus, Grafana, and Log AggregationAAP 2.6 REST API Guide: Automate the Automation PlatformAAP 2.6 Job Templates and Inventories: Complete Configuration Guide

Category: troubleshooting

Browse all Ansible tutorials · AnsiblePilot Home