Hi There, I have started on the Ansible beginner course and started to setup the . . .

Jeevanandham Poongavanam:
Hi There, I have started on the Ansible beginner course and started to setup the local virtualbox setup. I have a VM running (centos) on a bridged network. In the demo, the vm got new ip address but for me I always get the 127.0.0.1 address. I am on Mac and here is the network setting. Has anyone one encounter this issue and solved it?
network.jpg

Jeevanandham Poongavanam:
This is the demo video https://kodekloud.com/topic/demo-setup-ansible-local-environment-using-virtualbox-2/ Looks like it is completely outdated.

Mohamed Ayman:
Hello @Jeevanandham Poongavanam,
Can you please provide us with a screenshot of this command? nmcli connection show

Jeevanandham Poongavanam:
This is with bridge0
Screenshot 2022-10-09 at 17.31.46.png
Screenshot 2022-10-09 at 17.31.24.png

Jeevanandham Poongavanam:
This i with en0 wifi
Screenshot 2022-10-09 at 17.33.36.png

Mohamed Ayman:
Hello @Jeevanandham Poongavanam,
Try the following to set a static IP with the following steps,
Within the directory /etc/sysconfig/network-scripts/ you should find the file ifcfg-INTERFACENAME (Where INTERFACENAME is the name of your interface). Open the correct file for editing with the command sudo nano /etc/sysconfig/network-scripts/ifcfg-<INTERFACENAME> or using vim editor. We need to modify that file in order to not only change the protocol from dhcp to static, but to add the specific IP address. So when you open up that file, you’ll want to change BOOTPROTO=dhcp to BOOTPROTO=static
Now you’ll need to add the entries to set not only the IP address, but the netmask, gateway, and DNS addresses. At the bottom of that file, add the following.
IPADDR=192.168.1.200
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4
then restart the network service using this command systemctl restart network
Note: **you need to check your PC settings first and according to these settings you will set your IP to be in the same network of your PC so you will be able to connect to the VM using putty or mobaxtrem