Posts

Showing posts from December, 2020

Use Ansible playbook to Configure Reverse Proxy

Image
 Today, We will configure reverse proxy server with ansible. In other words it is a system having load balancers and servers.  We have mainly 3 parts in this architecture  1. Controller Node 2. Load Balancers 3. Servers We will update our inventory file.  Here, Loadbalancer groups has all ips of load balancers and servers group has all servers ips. Lets have a look at our playbook.  After running this playbook. Our Servers are started Our Load Balancers config file.                                                                                                                                                ...

Ansible Handlers

Image
 In this post, you will learn about ansible handlers. Handlers are like if and else in ansible, suppose you have a configuration file in httpd server, and you want whenever you change something in configuration file, the httpd service must restart. In this case we will use handlers.  Components-: Controller node(192.168.1.7), Target node(192.168.1.8) The ansible-playbook looks like  It will only run the handlers portion only when notify will be changed. Target Node-  httpd is running on 8081. Playbook running when conf file is changed Playbook running second time You can view the webpage running on port 8081 Thank You  for reading. I would like to thanks  Vimal Daga  Sir. ( https://www.linkedin.com/in/vimaldaga/ ) My Email — ayanchawlae@gmail.com My LinkedIn —   https://www.linkedin.com/in/ayanchawlae/

Configure Hadoop and start cluster services using Ansible Playbook

Image
 Today, we will learn how to configure hadoop cluster using ansible. Setup: We need 3 machines - Ansible controller node(192.168.1.7), Hadoop Namenode(192.168.1.9), Hadoop Datanode(192.168.1.8) Steps: namenode install java  install hadoop create a directory  hdfs-site file config  <property> <name>dfs.data.dir</name> <value>/nn<value> </property> format directory with hadoop core-site file config <property> <name>fs.default.name</name> <value>hdfs://192.168.1.9:9001<value> </property> stop firewall start service slavenode install java  install hadoop create a directory hdfs-site file config <property> <name>dfs.data.dir</name> <value>/dn<value> </property> core-site file config <property> <name>fs.default.name</name> <value>hdfs://192.168.1.9:9001<value> </property> stop firewall start ser...

Ansible PlayBook to Configure Docker and Exposing the container to Launch a website

Image
Ansible - It is a tool to automate manual tasks. We have to write the code in a file called Ansible Playbook. We can 1 Control Node that controls all the Target/Host Nodes. Ip of my Control Node - 192.168.1.7 Ip of my Target Node - 192.168.1.5 Tasks -  Configure Docker Start and enable Docker services Pull the httpd server image from the Docker Hub Run the docker container and expose it to the public Copy the html code in /var/www/html directory and start the web server First, we will put the IP address of our target node in inventory file of control node and put the location of our inventory file in the .cfg file of ansible. Now we, will start writing our YAML file or ansible-playbook. Ansible has multiple modules to do the tasks. On the top we will write the  - hosts: all This is the syntax of YAML. Then below it, tasks: This tells that we have to perform following tasks. You must have configured Yum repo. Install Docker Start Docker Install Python2 and 36 as if needed Insta...

How industries are solving challenges using Ansible

Image
Ansible is an open-source community project sponsored by Red Hat, it's the simplest way to automate IT. Ansible is the only automation language that can be used across entire IT teams from systems and network administrators to developers and managers. Ansible is used in multiple instances like -  Weekly system reboot:  There’s nothing worse than doing the same thing for 8 hours a day! Eliminate repetitive, manual processes with automation. Enforce security guidelines:  Rules are rules. It’s best to automate in an effort to achieve strict security standards. Monitor configuration drift:  Use check mode with Ansible tasks to enforce desired settings and see if your configuration has drifted. Disaster recovery:  Disaster recovery can involve a wide range of components. Act across different variables of the technology stack to identify problems and eliminate cross team dependencies.                        ...