Ansible Lab Setup
Prerequisite:
- VMware workstation- Centos, fedora operating system iso files.
- Install 2 machines one Control node and one for managed hosts.
Step 1: Install VMWare Workstation
Step 2: Install
workstation and server Operating system (GUI)
- Minimum partition 20 GB
-
Username
and password
§ username: student § password: student
Step 3: select virtual machine and clone as a servera
Step 4: open workstation
- Set the static IP address: 192.168.80.11/24
-
Set
hostname:
o
hostnamectl set-hostname workstation.lab.example.com
-
Username
student as root access
o
vim
/etc/sudoers.d/student
student ALL=(ALL) NOPASSWD:ALL
o
chmod
0440 /etc/sudoers.d/student
o
su
– student or
sudo su –
-
Add
hosts entry
o
vim
/etc/hosts
192.168.80.11
workstation.lab.example.com workstation
192.168.80.12 servera.lab.example.com
servera
Step 5: open Managed hosts
- Set the static IP address :
o 192.168.80.12/24
- Set hostname:
o hostnamectl set-hostname servera.lab.example.com
- Username student as root access
- student ALL=(ALL) NOPASSWD:ALL
o su – student or sudo su –
- Add hosts entry
o vim /etc/hosts
192.168.80.11 workstation.lab.example.com workstation
192.168.80.12 servera.lab.example.com servera
- Check ping working in both machine
o ping workstation or ping servera
- ssh-keygen
- ssh-copy-id student@servera.lab.example.com
- ssh servera
Leave a Comment