I'm back again with yet another question :) :
In chapter 10, on Guided Exercise #5 the 'ens4' interface being asked to use is not being recognized when I try and run the playbook. I should receive this output according to the workbook when veriyfing the configuration of ens4 interface:
Unfortunately, this is what I'm getting:
I'm not sure where I went wrong. My play gives me the below error:
Any advice would be appreciated!
It is because there is no ens34 adapter in servera.
In our NetLabs, the adapter is enp2s0
In other systems, it is enp8s0
In my home lab, it is enp1s0
You can ssh into servera and do an ip addr to see what it is in your case.
Or, from workstation: ssh servera 'ip addr | grep enp'
Or, using Ansible from workstation: ansible servera -m setup | grep interface
Once you have the proper adapter name, change the command to (using the above output):
ansible webservers -m setup -a 'filter=ansible_enp1s0'
Every setup would be different as noted by Tracy_Baker
Find out what interface name your server has; two methods of several.
from any terminal$ ssh USER@servera "ifconfig "
from your ansible work directory$ ansible servera -a ifconfig
where servera is in your inventory file
From the output locate the proper interface name and update the play.
It is because there is no ens34 adapter in servera.
In our NetLabs, the adapter is enp2s0
In other systems, it is enp8s0
In my home lab, it is enp1s0
You can ssh into servera and do an ip addr to see what it is in your case.
Or, from workstation: ssh servera 'ip addr | grep enp'
Or, using Ansible from workstation: ansible servera -m setup | grep interface
Once you have the proper adapter name, change the command to (using the above output):
ansible webservers -m setup -a 'filter=ansible_enp1s0'
Every setup would be different as noted by Tracy_Baker
Find out what interface name your server has; two methods of several.
from any terminal$ ssh USER@servera "ifconfig "
from your ansible work directory$ ansible servera -a ifconfig
where servera is in your inventory file
From the output locate the proper interface name and update the play.
Ah, sweet success! Thank you @Tracy_Baker and @TheOtherJFern for both the solution and explanation. I wish it was made more clear in the workbook (I literally thought I was supposed to use the given interface instead of finding it on servera) but then maybe this was something assumed students should already know. Either way, I now know how to find it myself! Thanks again!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.