Ansible inventory in one remote machine using command-line

You can specify inventory file host path or comma separated host list. Except “localhost”, you can always specify a inventory using “-i INVENTORY” or –inventory=INVENTORY. Also, there…

Read More

How to pass http proxy to ansible using environment variables?

It is quite possible that you may need to get package updates through a proxy, or even get some package updates through a proxy and access other…

Read More

Ansible Playbook Lab & Excercise – Part 7

Create a playbook where you should install a webserver into 2 OS type(Ubuntu and RHEL) with fact conditioning. and list out a directory which in “/etc” and…

Read More

Ansible Windows Playbook Lab & Excercise – Part 8

Write a playbook to Create a dir, named with your-name inside C:\HPE and create a file named with “readme.txt” inside “C:\HPE\ and content of the file should…

Read More

Ansible Windows Adhoc Commands Lab & Excercise – Part 2

Write a Adhoc command to Create a dir, named with your-name inside C:\HPE and create a file named with “readme.txt” inside “C:\HPE\ and content of the file…

Read More

How to install Ansible in Centos 7/RHEL 7?

How to install Ansible in Centos 7/RHEL 7? Install Ansible via Pip in RHEL/CENTOS Rajesh KumarI’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have…

Read More

Ansible Include and Import with differences explanined!

This is one of the most frequest questions being asked in my workshop is that differences between using import or include in Ansible. For example import_role or…

Read More

Understanding Ansible Architecture using diagram

What is Ansible? Rajesh KumarI’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel…

Read More

Order of operations during Ansible playbook parsing explained!

We will delve into some specifics of how a playbook is parsed for Order of operations. Ansible can be assumed to be executed in a top to…

Read More

Ansible Variable: How can I pass variable to ansible playbook in the command line?

It is possible to set variables at the command line using the –extra-vars (or -e) argument. Variables can be defined using a single quoted string (containing one…

Read More

How to specifying multiple groups in a playbook hosts specification?

By design, Ansible executes just one play at a time. Your playbook consists of two plays (the two items in the root-level YAML list defined by the…

Read More

Difference between ansible vars_files vs include_vars

Both of them have some commonalities but they solve different purposes. vars_files are read when the play starts. include_vars are read when the play reaches the task….

Read More

Working with Azure using Ansible

Ansible includes a suite of modules for interacting with “Azure Resource Manager”, giving you the tools to easily create and orchestrate infrastructure on the Microsoft Azure Cloud….

Read More

Calling Ansible handlers based on OS distributions

Rajesh KumarI’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday…

Read More

Reboot and wait for reboot to complete in Ansible playbook

Reference – https://blog.confirm.ch/calling-ansible-handlers-based-on-os-distributions/ Rajesh KumarI’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel…

Read More

Login to linux ansible remote server enabled with LDAP using SSH?

Here is the scnario which we tried last week with Pranav Goel in order to login the Ansible remote server which is enlabe with LDAP and become…

Read More

Ansible Role Project 1

Step 1 – Create a role which has following specification. Install a webserver httpd # use role/vars/ Add cond…httpd should be done only if RHEL. Copy a…

Read More

Ansible Tower Administration Guide

Ansible Tower Support – If you have paid membership, you can contact the support team at https://access.redhat.com How to understand Ansible Tower Subscription Types Self-Support Enterprise: Standard…

Read More

Ansible Variable Lab & Excercise – Part 6

Assigment 1 – Create a playbook and setup a webserver(httpd) and use httpd as a variable decalared in role var file Assigment 2 – Create a playbook…

Read More

Ansible Variable Lab & Excercise – Part 5

Assigment 1 – Create a playbook and setup a webserver(httpd) and use httpd as a variable decalared in inventory. Assigment 2 – Create a playbook and setup…

Read More

How to access Ansible remote machine using SSH user and key?

How to access Ansible remote machine using SSH user and key? There are following ways, you can autheticte linux remote server using Ansible. Method 1 – Password…

Read More

Ansible execution connection type

Ansible executes playbooks in the remote server using following connection type. To change the connection type, you need to pass host-specific parameter ansible_connection=<connector>, the connection type can…

Read More

Use of runtime variables to save into another variable using register in Ansible

Another major use of variables is running a command and using the result of that command to save the result into a variable   – hosts: all…

Read More

Ansible Variable: Ansible & Ansible Tower Variable Precedence Hierarchy

Ansible & Ansible Tower Variable Precedence Hierarchy (last listed wins) Rajesh KumarI’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I…

Read More

Run Ansible Adhoc commands or playbook in Local mode

If you are trying to run Ansible Adhoc commands or playbook in Local mode, these articles will help you. Ansible can’t run playbooks locally without ssh if…

Read More

Ansible Playbook Lab & Excercise – Part 4

Execution Mode – Remote Write a Ansible Playbook to create a group called “deploy” Write a Ansible Playbook to create a user called “deploy-user” which is part…

Read More

Ansible Adhoc Commands Lab & Excercise – Part 1

Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy How to verify? $ more /etc/group | grep deploy Program 2 – Write…

Read More