Linux Basic Commands and Description – Part 2

grep Commands: # grep root /etc/passwd (To print lines containing word root) # grep -c root /etc/passwd (To count the no. of lines containing word root) # grep -v root /etc/passwd (To print all lines except containing matched word “root”) # grep -cv root /etc/passwd (To count no. of lines occurred by –v) # grep […]

Some useful “YUM” and “RPM” Commands

some useful “yum” and “rpm” commands: # rpm –checksig <.rpm> (Need to check signature of an rpm) # rpm -ivh <rpm-package> (Installing an rpm package) # rpm -qpR <rpm-package> (Checking dependencies of rpm package before installing it) # rpm -ivh –nodeps <rpm-package> (Installing a rpm without dependencies) # rpm -qa <rpm> (Checking installed rpm) # […]

Ansible Roles

Ansible roles provode a framework so that you will have an organized structure of your projects that you are implementing to target hosts.It basically organize and package Ansible playbooks and associated files into reusable and modular units. It allows you to encapsulate specific tasks, configurations, and dependencies for a particular component or function within your […]

Ansible Template

Ansible has a features which is called “template” module, by using it you can generate configuration files dynamically by using Jinja2 templating.The template module allows you to create configuration files by combining a template file with variables and facts from your Ansible playbook. It uses the Jinja2 templating to put varibales details and build configuration […]

MacVLAN in Docker Networking

Macvlan in docker is a networking driver which allows you to create multiple virtual network interfaces (i.e.,MAC addresses) on a single physical network interface. And we can connect each of these virtual interfaces to a Docker container which gives each container its own unique network identity on the same physical network on which host IP […]

Disable Nagios alerts for a hostgroup

To disable Nagios alerts for a hostgroup, You need login to nagios server and make changes in your Nagios configuration. Basically, you’ll need to modify the hostgroup definition. Below are the setps needed to disable alerts for a hostgroup.Step1: Login to your Nagios server using SSH:Log in to the Nagios Server using SSH with user […]

How to pass variable while running playbook on command line

Let’s take an example of below playbook which has variables defined. You can see “vars” section of playbook. It has multiple variables like pkg, myuser etc. Now user is looking to change one variable during run time and rest can go same. You need to just pass value if variable while running playbook using option […]

How to add a network to a host for Virtual Machines via vsphere

We are adding a network to host so that we can communicate Virtual Machines via host. Below are the steps: Step1: Login to vpshere and select an host on which you are going to add network. Step2: Go to host > Virtual switches > ADD NETWORKING (Please make sure on which switch you are going […]

Ansible Vault

ansible-vault is a command-line tool which is part of Ansible. It is specifically designed to help you encrypt sensitive data within your Ansible playbooks and inventory files, ensuring that your sensitive information remains secure and safe. Ansible vault does not implement its own cryptographic functions instead it uses a external python toolkit.Below are some points […]

Ansible Playbook that runs multiple plays

Below is an example of a Ansible Playbook which runs multiple plays. Each play has its specific tasks. You can also define specific hosts group as well. – name: Play 1 – Install some dependencies hosts: web tasks: – name: update yum cache yum: update_cache: yes become: true – name: Install Apache web server yum: […]