How abhijitsharma806/aws-ansible-mysql-nginx-apache-wordpress works
Project Type and Purpose
• This is an infrastructure-as-code project using Ansible to provision and configure an AWS VPC, EC2 instances, networking (public/private subnets, NAT), services (Nginx load balancer, Apache HTTPD, MySQL master‐slave, WordPress), and an intermediate Ansible bastion server.
• README describes end-to-end automation: create VPC, subnets, NAT, EC2 launch, configure load‐balancer, database replication, Wordpress master & slave installations.
File Structure Analysis
• Top‐level:
• aws-ansible.yml – main playbook orchestrating four sequential sections.
• ansible.cfg, hosts – client configuration.
• roles/ – broken down by concern:
– ec2-launch: AWS resource creation (VPC, EC2, key pairs)
– hostip: inventory population scripts
– nginx-lb: Nginx LB installation & config
– ansibleserver: configures bastion Ansible server
– apache: installs Apache on private subnet servers
– master/slave: MySQL master/slave setup, replication scripts & templates
– wordpress, wordpress-slave: WordPress installs pointing to master or slave
– dbscript: data dump and replication‐position retrieval
• Patterns: modular roles (Separation of Concerns), sequential playbook sections, IaC for networking and config.
Key README Insights
• Four distinct playbook phases run in order from local then bastion:
1. ec2-launch & hostip (infrastructure provisioning)
2. nginx-lb & ansibleserver (LB & bastion setup)
3. apache, master, wordpress, dbscript (web+DB master+WordPress)
4. slave & wordpress-slave (DB slave + readonly WordPress)
• Technologies: AWS EC2/VPC, Ansible, Nginx, Apache, MySQL (MariaDB), WordPress, Bash scripts.