How myselfag/terraansibleops works
This repository automates AWS infrastructure provisioning and server configuration with Terraform and Ansible. The intended workflow is to provision resources, produce host information, then configure hosts through Ansible; the inventory script explicitly reads inventory.json and writes Ansible’s hosts.ini. The README is only a title, and the workflow and Terraform/Ansible sources were not sampled, so links involving their orchestration and resource relationships are limited to what the tree and sampled script support.
Main entry points: site.yml Ansible site play · main.tf Terraform root · terraform-ansible.yml Deployment workflow · inventory.py Inventory generator
Components 19
Infrastructure
- Deployment workflow
.github/workflows/terraform-ansible.yml - Terraform root
Terraform/main.tf - EC2 resources
Terraform/modules/ec2.tf - S3 resources
Terraform/modules/s3.tf - DynamoDB resources
Terraform/modules/dynamodb.tf - Remote state
Terraform/remote-backend/terraform.tf - Terraform outputs
Terraform/output.tf
Host inventory
- inventory.json
- Inventory generator
script/inventory.py - Ansible hosts
Ansible/inventory/hosts.ini
Configuration
- Ansible site play
Ansible/playbooks/site.yml - Common role
Ansible/roles/common/tasks/main.yml - Firewall role
Ansible/roles/firewall/tasks/main.yml - SSH role
Ansible/roles/ssh/tasks/main.yml - Apache role
Ansible/roles/apache/tasks/main.yml - Nginx role
Ansible/roles/nginx/tasks/main.yml
Other components
- Operator
- AWS
- Target servers
Connections 21
- Operator → Deployment workflow: triggers
- Deployment workflow → Terraform root: runs
- Terraform root → EC2 resources: defines
- Terraform root → S3 resources: defines
- Terraform root → DynamoDB resources: defines
- Terraform root → Remote state: uses state
- Terraform root → Terraform outputs: exposes
- EC2 resources → AWS: provisions
- S3 resources → AWS: provisions
- DynamoDB resources → AWS: provisions
- inventory.json → Inventory generator: reads
- Inventory generator → Ansible hosts: writes
- Deployment workflow → Inventory generator: runs
- Deployment workflow → Ansible site play: runs
- Ansible site play → Ansible hosts: targets
- Ansible site play → Common role: applies
- Ansible site play → Firewall role: applies
- Ansible site play → SSH role: applies
- Ansible site play → Apache role: applies
- Ansible site play → Nginx role: applies
- Ansible site play → Target servers: configures