ARTH Task-14.3
Create an Ansible Playbook which will dynamically load the variable file named same as OS_name and just by using the variable names we can Configure our target node
To solve this task We will launch 2 instances on AWS cloud.One O.S is controller node and other is manage node
● Firstly in controller node we need to install ansible , Before this we have to install python3
● Now we will install ansible using command
● Pip3 install ansible
Now we will setup configuration of ansible by making a directory mkdir /etc/ansible and we will write in config file Vim ansible.cfg

After setting up the configuration file, next step is to create inventory. To create an Inventory create a text file and inside the text file provide managed node IP address, username, password, and connection type as shown.

First i’m going to create one folder under which i’ll keep my every var files and others. In this file I have created an web page in html which will tell the file is configured according to our OS name

Vars file

Main playbook

Run the playbook with the command:
ansible-playbook <file name>
Output:
