Execute Ansible playbooks in response to ServiceNow incidents
- Triggers the execution of Ansible playbooks in response to ServiceNow incidents
- Adds handled incidents to a database to prevent duplicate playbook executions
- Removes incidents from the database after one year
- Adds running Ansible jobs to a database to track job status
- Removes jobs from the database after completion
- Updates incident work notes when executing playbooks and when jobs complete
- Detailed logging with file rotation
- Email notifications on errors
- Command line arguments for populating the handled incidents database only and testing
- Containerized to eliminate dependency issues
docker build -t ansiblenow .
docker run --rm --env-file .env -v $(pwd):/usr/src/ansiblenow ansiblenow python ansiblenow.py --test
docker run --rm --env-file .env -itv $(pwd):/usr/src/ansiblenow ansiblenow /bin/bash
docker run --rm --env-file .env -v $(pwd):/usr/src/ansiblenow ansiblenow
ansiblenow.py
: Main Python scriptDockerfile
: Docker build filerequirements.txt
: Python dependencies.env.example
: Example environment file