Automated deployment and lifecycle management of AppDynamics Smart Agent across multiple EC2 hosts using GitHub Actions with a self-hosted runner.
https://github.com/chambear2809/github-actions-lab/tree/main
This lab demonstrates how to use GitHub Actions to manage AppDynamics Smart Agent and various AppDynamics agents (Node, Machine, DB, Java) across multiple Ubuntu EC2 instances within a single AWS VPC. The project includes 11 automated workflows covering the complete agent lifecycle.
Key Features:
All infrastructure runs in a single AWS VPC with a shared security group. The self-hosted runner communicates with target hosts via private IPs.
View detailed architecture diagrams →
git clone https://github.com/chambear2809/github-actions-lab.git
cd github-actions-labNavigate to: Settings → Secrets and variables → Actions
Required Secret:
Navigate to: Settings → Secrets and variables → Actions → Variables
Required Variable:
172.31.1.243 172.31.1.48 172.31.1.5
Optional Variables:
Via GitHub UI:
Via GitHub CLI:
gh workflow run "Deploy Smart Agent" --repo chambear2809/github-actions-lab # With custom batch size gh workflow run "Deploy Smart Agent" --repo chambear2809/github-actions-lab -f batch_size=128
Workflow Description Scale Trigger
| Deploy Smart Agent (Batched) | Installs Smart Agent and starts service | Any | Manual only |
Workflow Command Scale Trigger
| Install Node Agent (Batched) | smartagentctl install node | Any | Manual only |
| Install Machine Agent (Batched) | smartagentctl install machine | Any | Manual only |
| Install DB Agent (Batched) | smartagentctl install db | Any | Manual only |
| Install Java Agent (Batched) | smartagentctl install java | Any | Manual only |
Workflow Command Scale Trigger
| Uninstall Node Agent (Batched) | smartagentctl uninstall node | Any | Manual only |
| Uninstall Machine Agent (Batched) | smartagentctl uninstall machine | Any | Manual only |
| Uninstall DB Agent (Batched) | smartagentctl uninstall db | Any | Manual only |
| Uninstall Java Agent (Batched) | smartagentctl uninstall java | Any | Manual only |
Workflow Description Scale Trigger
| Stop and Clean Smart Agent (Batched) | Stops service and purges data | Any | Manual only |
| Cleanup All Agents (Batched) | Deletes /opt/appdynamics directory | Any | Manual only |
Total: 11 workflows - All batched workflows support configurable batch sizes (default: 256)
All workflows use automatic batching to support any number of hosts:
Examples:
This is a lab/demo project. Feel free to fork and adapt for your own use cases!