Posts

Showing posts from September, 2023

DevOps(Day-75): Ansible Playbooks - Part2

Image
  TABLE OF CONTENTS Task-02: Explaining Ansible Playbook Task-02: Explaining Ansible Playbook Write a blog about writing Ansible playbooks with the best practices. An Ansible playbook is a configuration management tool that allows you to automate IT infrastructure tasks, such as deploying applications, configuring servers, and managing network devices. It is written in YAML format and consists of a series of tasks that are executed on one or more hosts. The structure of an Ansible playbook consists of several sections: Hosts:  This section defines the target hosts that the playbook will run on. This can be a single host or a group of hosts. You can specify hosts by name, IP address, or through a dynamic inventory. Variables:  This section defines the variables that will be used in the playbook. Variables can be defined at different levels of scope, such as at the playbook level, the host level, or the task level. They can be used to store data that will be reused throughout the playboo

DevOps(Day-74): Ansible Playbooks - Part1

Image
  TABLE OF CONTENTS Ansible Playbooks Task-01: Creating a user and installing Docker Ansible Playbooks Ansible playbooks run multiple tasks, assign roles, and define configurations, deployment steps, and variables. If you’re using multiple servers, Ansible playbooks organize the steps between the assembled machines or servers and get them organized and running in the way the users need them to. Consider playbooks as the equivalent of instruction manuals. Task-01: Creating a user and installing Docker Write an Ansible playbook to create a file on a different server Connect the node server to the master server by writing the host file. We can display the ansible playbook as below. Write an Ansible playbook to create a new user. Create the ansible-playbook file to create a user in both the node servers. Run the ansible-playbook file to create the user. Let's check in both servers if the users are created. Write an Ansible playbook to install docker on a group of servers Create an ansi

DevOps(Day-73): Project - Deploying a nginx webapp through AWS Fargate, ECS & ECR - Part2

Image
  TABLE OF CONTENTS Pushing the image to ECR Configuring AWS ECS Using AWS Fargate Open port in the security group. Project live execution Aim Deploying an Nginx application image through AWS ECR to AWS Fargate and ECS to make our application live. Pushing the image to ECR Navigate to the AWS ECR and view the push commands. Earlier, we had pushed the image to DockerHub in my previous blogs. The steps and concepts are similar but the platform differs. Generally in IT industry ECR is used as an image registry. Execute commands 1 and 2 in the EC2 instance. Command 1:  This will take the ecr token and provide to docker for the connection to the repository. Command 2:  This will build the image from the Dockerfile. Execute commands 3 and 4 in EC2 instance. Command 3:  This tags the image that we have built using docker. Command 4:  This command will push the image from EC2 instance to ECR. After the image push, you can check the ECR for the image. Configuring AWS ECS Navigate to the ECS rep