Understanding Notifications
The notification system consists of:- Notification Templates: Configured notification channels
- Notification Triggers: When to send (start, success, error)
- Notification Messages: Customizable content with job details
- Notification Hierarchy: Inherited from organizations and projects
Notification Triggers
Started
Sent when job starts execution
Success
Sent when job completes successfully
Error/Failure
Sent when job fails or errors
Supported Notification Types
AWX supports these notification channels:- Email - SMTP email notifications
- Slack - Slack channel messages
- Mattermost - Mattermost webhooks
- Rocket.Chat - Rocket.Chat webhooks
- Pagerduty - Pagerduty incident creation
- Twilio - SMS via Twilio
- IRC - IRC channel messages
- Webhook - Custom HTTP webhooks
- Grafana - Grafana annotations
Creating Email Notifications
Create Email Notification Template
- Web UI
- API
- Ansible
- Navigate to Notification Templates
- Click Add
- Enter details:
- Name: Descriptive name
- Organization: Optional organization
- Type: Email
- Configure email settings:
- Host: SMTP server hostname
- Port: SMTP port (25, 465, 587)
- Username: SMTP username
- Password: SMTP password
- Sender Email: From address
- Recipients: Comma-separated email list
- Use TLS: Enable for encrypted connection
- Click Save
Slack Notifications
Integrate with Slack using bot tokens:Setting up Slack
Create Slack App
- Go to https://api.slack.com/apps
- Click Create New App
- Choose From scratch
- Name your app (e.g., “AWX Notifications”)
Configure Bot Token
- Go to OAuth & Permissions
- Add Bot Token Scopes:
chat:writechat:write.public
- Install app to workspace
- Copy Bot User OAuth Token
Webhook Notifications
Send custom HTTP webhooks:Webhook Payload
AWX sends job details in JSON format:Mattermost Notifications
Use incoming webhooks:Mattermost Setup
- Go to Main Menu → Integrations → Incoming Webhooks
- Click Add Incoming Webhook
- Configure:
- Display Name
- Description
- Channel (can be overridden in AWX)
- Copy the webhook URL
Pagerduty Integration
Create incidents in Pagerduty:Pagerduty Setup
- In Pagerduty, create a new service
- Select Events API V2 integration
- Copy the Integration Key (use as
service_key) - Get API token from User Settings → API Access Keys
Custom Notification Messages
Customize notification content with Jinja2 templates:Available Template Variables
Common variables for templates:Notification Hierarchy
Notifications inherit from parent resources:Job Template Notifications
Workflow Notifications
Example Hierarchy
Attaching Notifications
To Job Templates
To Projects
To Organizations
To Workflows
Notification Status
View notification history:- pending: Queued for sending
- successful: Sent successfully
- failed: Failed to send
Advanced Configurations
Multiple Recipients
Conditional Notifications
Use different notifications for different job templates:Rate Limiting
AWX does not have built-in rate limiting for notifications. Consider:- External notification aggregation
- Webhook endpoints that handle deduplication
- Scheduled summary reports instead of per-job notifications
Troubleshooting
Email notifications not sending
Email notifications not sending
Check:
- SMTP credentials are correct
- SMTP port is accessible from AWX (telnet test)
- TLS/SSL settings match server requirements
- Firewall allows outbound SMTP
Slack notifications failing
Slack notifications failing
Verify:
- Bot token is correct and starts with
xoxb- - Bot has
chat:writepermission - Channel name includes # (e.g.,
#devops) - Bot is invited to private channels
Webhook notifications returning errors
Webhook notifications returning errors
Debug:
- Check webhook URL is accessible
- Verify authentication headers
- Review webhook endpoint logs
- Test with curl:
Notifications not triggering
Notifications not triggering
Verify:
- Notification template is attached to the resource
- Correct trigger type (started/success/error)
- Notification template is enabled
Best Practices
Use Hierarchy
Set organization-level notifications for common alerts, job-level for specific needs
Test First
Always test notification templates before attaching to production jobs
Customize Messages
Use custom messages to provide relevant context and actionable information
Monitor Delivery
Regularly check notification history to ensure delivery success
Related Resources
Job Templates
Create jobs that trigger notifications
Workflows
Configure notifications for workflows
Scheduling
Combine schedules with notifications for automated monitoring
Notification API
Complete API reference for notifications