Skip to content
All projects
Automation & IaC

CloudFormation + Ansible Server Builder

Automates the provisioning of secure AWS infrastructure using CloudFormation and Ansible, including a bastion host and control node for scalable and maintainable cloud management.

Role
Personal project
Timeline
2024
CloudFormation + Ansible
Auto

// architecture

Context

A project to learn configuration management end to end: use CloudFormation to lay down the AWS foundation, then hand off to Ansible to configure the hosts — including a bastion host and an Ansible control node for secure access.

// images

A Git repository containing all necessary Ansible playbooks is cloned to facilitate server management.
Ansible playbooks are executed from the Control Node to create and configure test servers according to predefined specifications.

Challenges

  • Designing a secure AWS network with separate public/private subnets, gateways, security groups, and controlled access paths.
  • Bootstrapping the Ansible Control Node reliably during CloudFormation deployment with Python, Git, boto3, and Ansible dependencies.
  • Managing only the required automation files from the repository while keeping the deployment process clean and repeatable.

Approach

  • Used CloudFormation to provision the VPC, subnets, Internet Gateway, NAT Gateway, security groups, bastion host, and Ansible Control Node.
  • Configured the Ansible Control Node during launch so it could immediately run playbooks for EC2 provisioning and teardown.
  • Routed SSH access through a bastion host to avoid direct exposure of the control node.

Outcomes

  • Created a repeatable infrastructure deployment workflow combining CloudFormation for provisioning and Ansible for configuration automation.
  • Improved security by isolating the control node and using a bastion host for administrative access.
  • Gained practical experience with cloud bootstrapping, dependency management, and repository organization for infrastructure automation.

// stack

  • CloudFormation
  • Ansible
  • AWS
  • EC2
  • Bastion Host
  • Bash