Projects are a great way to apply your knowledge, improve the skills you’ve learned and put your skills to test. It is a great way to get that exposure that you get by working on an actual project with an actual use case. And thus gain deeper Insights into the product and ensure the skills you learned last long in your mind. Share your solution and receive feedbacks and learn with a global community.
In this project we are going to present you with a challenge and you are going to develop a project to solve it using Ansible. We will use open-source and free resources available out there to develop the project. This way you get exposure to a lot of other tools and platforms while you are working on the assignment.
So, let’s look at the challenge at hand. We are tasked to deploy a web application from ground up, on a cloud provider of choice. So the first task is to deploy the required servers. Deploy as many servers required based on user input and designate them as web and database servers. We will be using the same simple web application we used in our demos to keep it simple. So install the necessary dependencies on the servers. Then install the actual application. We would be installing flask on the web servers and mysql on the database server. Then download the source code from the git repository. You could either use the source code I have in my github repository or fork it and create one on your own. Then run the necessary services on each servers. We will then configure load balancing to distribute traffic across all web servers. Finally send out a notification email stating the work is complete and we will add information about the servers in there.
Design Considerations:
Let us look at some design considerations. The servers could be deployed on any cloud platform of your choice, such as AWS, Google, Azure or even a private cloud setup like VMWare. As we discussed we must be deploying the application in a distributed model, meaning we will reserve one database server and others for web. The source code repository could be github or bitbucket or any repository of your choice. Ultimately the Ansible playbook must download the code from the repository. And then once services are started and the web servers are up, configure load balancing. It could be a native load balancing as a service supported by cloud service providers, like Elastic Load Balancing in AWS or it could be a software loadbalancer that you can install and configure on one of the servers like NGINX, HAPROXY or even lighttpd. It could be really simple.
Solution Considerations:
Here are some ideas to get started and develop the project. First of all, you need a development environment to play around with. All public cloud providers such as AWS, Google Cloud and Azure offer free trial period. If you haven’t signed up already, sign up for the free tier and you get to play around with free VMs. Google offers upto 300$ worth of free resources. Just make sure you keep an eye on the usage. Research on existing roles to deploy VMs on Cloud and on configuring them. Research on roles to install and configure applications like mysql and flask. Create your own roles if required. Research existing cloud modules available to deploy VMs on cloud. Explore git modules to download source code. You may want to use Dynamic Inventory to get inventory information of deployed VMs. Secure credentials using Ansible Vault.
Feel free to use containers if you wish to containerize application. However this is not mandatory.
Finally the solution must be submitted in the form of a github repository. So if you do not have a github account this is the right time to create one. You don’t need to be an expert in git, but learning the real basics to create a repository and how to check in some code will help.