Skip to main content

Command Palette

Search for a command to run...

Ansible Project (Deploying a Simple HTML Project with Nginx)

Published
3 min read
Ansible Project (Deploying a Simple HTML Project with Nginx)
G

Gurucharan DevOps Engineer | Continuous Integration/Continuous Deployment | Automation Enthusiast

Welcome to my LinkedIn profile! I'm an aspiring DevOps engineer with a strong background in software development and system administration. My goal is to bridge the gap between development and operations, delivering efficient and reliable software solutions through seamless collaboration.

With experience in continuous integration/continuous deployment (CI/CD) pipelines, I specialize in automating software delivery processes to enhance development efficiency and quality. I excel in fast-paced, dynamic environments, leveraging infrastructure as code (IaC) tools like Terraform and cloud platforms such as AWS, Azure, and GCP to create scalable and resilient architectures.

My technical skill set includes proficiency in scripting languages (Python, Bash), containerization technologies (Docker, Kubernetes), and configuration management tools (Ansible, Chef). I possess a deep understanding of networking protocols and security principles, ensuring robust and secure environments.

Beyond technical experience, I believe in collaboration, cross-functional teams, and continuous learning. I thrive on solving complex challenges and seek opportunities for growth and innovation.

If you're looking for a passionate DevOps engineer to streamline software delivery, enhance system reliability, and drive organizational success, let's connect! I'm open to exciting opportunities and collaborations. Feel free to reach out via LinkedIn or email.

Let's build the bridge between development and operations, enabling continuous improvement and innovation!

In this project, we will be deploying an HTML webpage using Ansible with the help of Nginx. Ansible is a powerful automation tool that allows us to manage and configure infrastructure efficiently, while Nginx is a popular web server that can efficiently serve static content.

The objective of this project is to automate the deployment process and ensure that our HTML webpage is accessible to users through the Nginx web server. By using Ansible, we can easily manage the installation of Nginx, start the Nginx service, and deploy the HTML webpage and associated files to the appropriate directory.

Let's get started and deploy our HTML webpage with Ansible and Nginx!


Step 1: Make two instances

naming master and worker like this

Step 2: Make an inventories folder like this

go that folder

Step 2: Make file pro_inv inside the inventories folder

Step 4: Add these things inside the prod_inv file

and also mentioned the worker instance IP address

Step 5: Then go to this directory

and copy the path shown in the image

Step 6: Open another terminal in which instance key stored

specify the key which you want and past that path here and also add scp instead of ssh

run this command

Step 7: Here you can see we have copied out key.pem file to the master server

Step 8: Give this file read access

by running these commands

Step 9: Now run this command in inventories directory

Here you can see we have successfully connected master server to worker server

Step 10: Come back to the cd directory

Step 11: Make an index.html file

add your required code to it

Step 12: Make a style.css file

add your CSS code to it

Step 13: Make a deploy_webpage

and add these inside it

here src index.html refer to previous we have made HTML file and same goes to src styles.css

Step 14: In the end, your server should have these file and a folder

like this

Step 15: Run this command to deploy the webpage in the worker server

here you can see we have successfully deployed it

Step 16: To check in which IP address our webpage running

run this command

here you can see the IP address

Step 17: Paste that IP address in the browser

here you can see our webpage is running successfully


conclusion

Through this project, we aim to simplify the deployment process, save time, and ensure consistency across different environments. Ansible's declarative syntax and Nginx's efficiency make this combination a powerful choice for deploying webpages.


Thank you for reading this blog and if any queries or if any corrections to be done in this blog please let me know.

contact us in Linkedin ,Twitter or email-id gurucharanu716@gmail.com