Stage 4 · Provision
Observability-Driven Remediation
ChatOps Automation
Run approved playbooks from Slack or Teams with AWX surveys, RBAC, and audit trails.
What Is ChatOps?
ChatOps runs automation from chat platforms. Team members type commands like deploy production or restart web1 in Slack, and the bot executes the corresponding Ansible playbook. This makes automation accessible and creates a shared audit trail.
AWX + Slack Integration
---
# Slack bot architecture
# 1. User types /deploy in Slack
# 2. Slack sends webhook to bot
# 3. Bot calls AWX API to launch job template
# 4. AWX returns job URL
# 5. Bot posts job URL back to Slack
# 6. AWX notifies Slack on job completion
# AWX notification configuration
- name: Configure Slack notifications
ansible.controller.notification:
name: "Slack Deploy Notifications"
notification_type: "slack"
notification_configuration:
token: "{{ slack_bot_token }}"
channels:
- "#deployments"
- "#ops-alerts"
state: presentAWX integrates natively with Slack. Configure notification channels and job templates to enable ChatOps.
RBAC in ChatOps
---
# AWX RBAC for ChatOps
# Team: Deployers
# - Can execute: deploy-playbook
# - Can execute: rollback-playbook
# - Cannot: delete-inventory, modify-credentials
# Team: Viewers
# - Can view: all job templates
# - Cannot: execute anything
# Team: Admins
# - Can execute: all job templates
# - Can modify: inventories, credentials
# Slack channel restrictions
# #deployments - Deployers can execute
# #ops-alerts - Viewers can see notifications
# #admin - Admins onlyChatOps inherits AWX RBAC. Only authorized users can execute specific playbooks. This prevents unauthorized actions.
Surveys in Chat
# User types: /deploy
# Bot responds with survey:
# Deploy Application
# Version: [________] (e.g., v2.1.0)
# Environment: [staging ▼]
# Notify: [#deployments]
# User fills in survey and clicks Submit
# Bot calls AWX with survey responses
# AWX launches job with provided variablesSurveys make ChatOps interactive. Users provide inputs through a form instead of memorizing command syntax.
ChatOps Audit Trails
# Every ChatOps action creates an audit trail:
# 1. Slack message history shows who requested what
# 2. AWX job output shows what ran and when
# 3. Notification channels show success/failure
# 4. Combined: complete audit of who did what
# Slack message example:
# [10:30 AM] alice: /deploy v2.1.0 production
# [10:30 AM] deploy-bot: Launching job template...
# [10:30 AM] deploy-bot: Job #1234 started: https://awx.example.com/#/jobs/1234
# [10:35 AM] deploy-bot: Job #1234 completed: SUCCESS
# [10:35 AM] deploy-bot: Deployed v2.1.0 to production (5 hosts)ChatOps creates natural audit trails in chat history. Combined with AWX logs, you have complete visibility into who did what and when.
Begin ChatOps with status checks and read-only commands. Once the team trusts the system, add deployment and remediation commands with approval gates.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.