Skip to main content

Posts

Showing posts with the label DevOps

call to function "map" failed: the "map" function was deprecated in Terrafrom

How to change map method to tomap method? Let's say you have multiple tags in your code which was written quite back and that time it was working fine on old Terraform version before v0.12 but if the same code you execute on updated/latest Terrafrom you get subjected error while try to run Terrafrom plan command. Then this article will help you to fix your issue. What is simple solution to fix this issue? Just replace " map " method to " tomap " and just to little bit formatting for the same. Syntax:- map ({"Name", "My_Name"), map("AppName", "My_App")}) tomap ({"Name"  =   "My_Name",  "App_Name"  =   "My_App"}) or tomap ({     "Name"  =   "My_Name",     "App_Name"  =   "My_App" }) #Code with " map " method resource "aws_instance" "My_instance"   ami   =   my_ami   instance_type =   my_type   tags  =   merge(var.tag...

Please add this host's fingerprint to your known_hosts file to manage this host

Error: - 192.168.43.216 | FAILED! => {     "msg": "Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.  Please add this host's fingerprint to your known_hosts file to manage this host." }  If you get above error message on Ansible controller that means your managed host are not added to known hosts. You can fix this issue in two way: - 1. Add " host_key_checking = false " in ansible.cfg( best practice ) [root@ansible ssh]# cat >> /etc/ansible/ansible.cfg host_key_checking = false Let's check if issue has been fixed, If I am getting "ping": "pong" response that mean the issue has been fixed. [root@ansible ssh]# ansible all -m ping 192.168.43.72 | SUCCESS => {     "ansible_facts": {         "discovered_interpreter_python": "/usr/libexec/platform-python"     },     "changed": false,     "ping": ...

Ansible ad-hoc commands and playbook

In previous post we have understood the usage and basics of Ansible. Also we have have installed Ansible on RHEL8 and setup our Lab environment so that we can practice. Now this is time to move ahead and learn more about Ansible and see how we can use an intelligent configuration management automation tool in our environment. There are two types of automation approaches we can adopt in our environment for configuration management: - 1. Traditional Automation: - Automation using scripts which can be written in any scripting language (Shell, Perl, Python etc.). In this approach as per requirement we write a script and whenever we run this script it do the needful. This kind of automation works fine until there is any change in environment. But as we know this is not possible, our environment keep on changes and slight change may fail our automation completely. How? Example: - Configure httpd on RHEL6 , below are the simple commands we use to configure httpd in RHEL6. Which we can put ...

Introduction to Ansible

Introduction to Ansible :- Ansible is a very intelligent and powerful tool in terms of Configuration management. In very simple language we can say that it is a  configuration management automation tool.  Apart from that it has capability to do multiple of things in IT world like  software provisioning  and  application-deployment tool enabling infrastructure as code . In terms on platform support, so it can be run on UNIX/Linux system and can configure UNIX/Linux and Windows both kind of operating systems.  From today onward I'll start posting each and everything about Ansible, so you can start an technical journey which will help you to learn Ansible tool from zero to advance level. Since it is very first day so we will try to setup our lab environment and also try to do a simple configuration on a remote host.  I have two RHEL8( Red Hat Enterprise Linux 8 ) virtual machine installed on Oracle VirtualBox machines. The host on which we install...

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Root cause of this error message is only that DOCKER_HOST variable has not been exported to all the users. In my case it was working fine while I was running docker commands as root user but when I tried the same commands from Jenkins, didn't work. To understand this issue in detail let me create such environment and see troubleshooting steps. Docker Host - [root@server106 ~]# hostname server106.example.com Docker Client - [root@server109 ~]# hostname server109.example.com [root@server109 ~]# docker ps -a CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES [root@server109 ~]# docker ...

DevOps : Integration of Git, GitHub, Jenkins, Docker and Linux

  If you have knowledge of a subject, it is always great but if know how and where you can utilize it became your talent. Likewise if you have knowledge of some technologies and also know how to use them. In other words I would like to say, you know how to integrate these technologies? Just by doing this you can create your own product, you can become a creator. I have lots of examples of it, but one of them is OpenStack (Collection of lots of services like Glance, shift, cinder, nova, neutron, Gnocchi etc).   I am also writing this post to show you an interesting demo. In which I'll integrate multiple tools like Git, GitHub, Jenkins, Docker, Linux etc. and I will try to solve a use case. We have a web app developed by multiple developers will be first of all deploy in test environment, Then it will be checked by UAT team and if everything is fine and approved all the requirement from QAT team then automatically deployed in production environment. So lets start with...

Push a local repository on GitHub and Configure web server automatically.

If you are looking for a solution that your developer develop a web app and you would like to manage it using SCM(Git) and then share code on GitHub. After that move web app code in document root of web server. So in short we can say that how to deploy web application using Jenkins? Step 1 :- Create Git local repository Priyanshi@Priyanshi-PC MINGW64 /d/My/Msi Laptop/Training/DevOpsAL/Practice/Day4 $ pwd /d/My/Msi Laptop/Training/DevOpsAL/Practice/Day4 $ ls $ mkdir myws4 $ cd myws4/ $ ls -la total 4 drwxr-xr-x 1 Priyanshi 197121 0 May  3 11:09 ./ drwxr-xr-x 1 Priyanshi 197121 0 May  3 11:09 ../ drwxr-xr-x 1 Priyanshi 197121 0 May  3 11:09 .git/ $ touch index.html web.html $ cat >> index.html This is my home page $ cat >> web.html This is my another web page $ ls index.html  web.html $ git init Initialized empty Git repository in D:/My/MsiLaptop/Training/DevOpsAL/Practice/Day4/myws4/.git/ $ git ad...

What is GIT and GITHUB?, How to use GIT and GITHUB?

  SCM(Source code management) is a very important area for all the developers who are working in team. If multiple developer are writing code for an application then it is very important to manage that code properly for fast delivery. There are lots of tools available in market like Mercurial SCM, Apache Subversion, Fossil, Git & GitHub .   You can think like code can be shared using emails, shared drives or somehow using file share techniques as well, then why SCM is required? Yes, you are correct if we just want to share code then these medium you can use. These are easy mediums but query comes that how you will track the code?, how you will check who has written and what has written? for this we need a code tracking technique and this kind of code tracking is known as versioning(version control). So finally we can say that using SCM we can share the code between multiple developers and also track the code and maintain versioning of it.   There are two types of S...