Skip to main content

Posts

Showing posts with the label Ansible

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...