Help on ansible for beginers

am trying to set up my own ansible after practing with the lab, but i got stuck

although i use vagrant to run my VM and i was able to ssh btw both VM, my issue here is, i tried to ssh the target1 VM, giving it the ip address, followed by password and user ID, with the command vi /etc/ansible/hosts,

even when i tried to edit the inventory file, it wont work, i find out its on READ-ONLY, i can’t write on it.

is there a way i can resolve this issue?. if i can get a video tutorial on how to resolved it, i would be glad, but i need help

thanks so much
i awaits your fast response

Run sudo su, then vi /etc/ansible/hosts or sudo vi /etc/ansible/hosts

thanks, the other issues i am facing now, is to ssh into a host on the inventory file, after typing the host name and ip address, and also giving it a user id and a password, after which i created my playbook file using yml, when i run the playbook this is what i see, “{warning} could not match supplied host pattern ignoring” i need help on that

thanks for your swift response

Can you share the content of your yaml? and your steps?

@Ayman i have tried taking screenshot of my virtualbox but its not working,

i use vagrant to open a vm with the virtualbox, and what i find out that, the clone vm is still having same ip with the main vm, this is what i find out, and i have been stuck here for days now, please what do you suggest i should do? should i create a vm manually without using vagrant? but if so, i am using UBUNTU, will i have to still download an OS imagine thorugh osboxes?

its getting me so frustrated, i would really appreatiate if you can show me how to do it using vagrant
and also i tried taking screenshot or screenrecord of my virtual box, but it won’t screenshot, but i can screenshot normally, but can’t screenshot the virtualbox

Try $ sudo pkill dhcliet then $ sudo dhcliet. Can you share your vagranfile?

@Ayman here is my vagrantfile, what else should i do?

@Ayman am yet to see your response, am still stuck on this, hwo do i go about it?

I think the issue with not the IP? I recommend downloading the OS image through osboxes and trying it without vagrant.