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 […]

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 […]

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: […]

Privileged Escalation in Ansible

In Ansible, privileged escalation refers to the process of elevating the permissions of a user or a process to gain higher levels of access or privilege on a remote system when you are performing any taks on managed systems. This is required when performing certain administrative tasks that demand superuser or administrative privileges, such as […]

QA on Ansible

Q.1 What is Ansible and what are its features? Ansible is an open-source automation tool that helps the deployment, configuration management, and orchestration of IT infrastructure. It is designed to automate repetitive tasks and you can configure lot of things using this tool.It is Agentless. Ansible uses a push-based architecture so it does not require […]

How to install Ansible and enable passwordless SSH authentication with nodes on Linux

Step1: Install Ansible: # yum install ansible Step2: Generate an SSH key pair on the control node: # ssh-keygen Go for default options for key name and location and leave passphrase blank. Step3: Copy the public key to the remote nodes from control node. # ssh-copy-id username@remote_host (Put username and hostname of remote machines) Step4: […]

Docker Commands

# systemctl start docker (Starting Docker service) # systemctl enable docker (Enabling Docker at boot level) # docker –version (Checking Docker version) # docker info (Gives all information about host and containers) # docker run/pull image (images can be downloaded from Docker Hub) # docker run hello-world (Just download and start a test container) # […]