I am doing the self-paced course RH294 . With two exercises (Ch.3 final Lab and Ch.4 lab exercise 2) I ran into this problem:
after installing and starting a web service, from the classroom web termicaI I cannot reach servera.lab.example.com with curl: "No route to host". This despite the fact that I can ping it, open a shell to it, and install the package on it with Ansible.
Anyone else have the same problem?
What might be the cause?
Apparently `lab finish` removes (a.o.) the /var/www/* , but does not remove the httpd-filesystem package, possibly because other packages depend on it So serverb is left in an inconsistent state.
I now managed to run the `lab grade data-review` successfully, so consider this issue solved.
I've seen errors when teaching the class and in most cases, students have not had the firewall running or the service wasn't running. Seeing the entire playbook is what is needed.
The "curl" command connects on port 80 so if that is blocked by the firewall, you get no routte to host. So, it isn't a network glitch as you can do regular pings. Ansible is able to customize things as servera and the rest of the servers have port 22 open on the firewall for SSH. However, the Linux servers do not have port 80/tcp open.
I would venture a guess that if you would do a "firewall-cmd --add-service=http" or a "firewall-cmd --add-port=80/tcp" that the curl command would work.
It looks like the lab environment wants you to use HTTPS, so it is important when testing with curl to use the port. It is also important to check the playbook to ensure firewalld opened the correct ports.
From what I can see, chapter 3 final lab (data review) uses serverb not servera and for exercise 2 of chapter 4 (control handlers) it doesn't open the firewall, as it is more about proving the function of the handlers rather than actually building another web server, so I don't think a response is expected and no curl test is asked for.
Chetan (and pjentw), thank you for your response. Only now I find time to attend this again.
Indeed I ran it against serverb which is in the inventory, not servera. I did the curl myself because the lab-grade failed.
I try to run the data-review again, but it now fails at another check:
%<---
[student@workstation ~]$ lab start data-review
Starting lab.
· Checking lab systems ............................................................................................................................................... SUCCESS
· Adding exercise content ............................................................................................................................................ SUCCESS
· Ensuring required packages are installed ........................................................................................................................... SUCCESS
· Setting up exercise ................................................................................................................................................ SUCCESS
--- >%
%<---
[student@workstation data-review]$ ansible-navigator run -m stdout --playbook-artifact-enable false playbook.yml --vault-id @prompt
Vault password (default):
PLAY [Data Review playbook] *****************************************************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************
ok: [serverb.lab.example.com]
TASK [Install packages] *********************************************************************************************************************************************************
changed: [serverb.lab.example.com]
TASK [Copy httpd.conf] **********************************************************************************************************************************************************
changed: [serverb.lab.example.com]
TASK [Create secrets directory] *************************************************************************************************************************************************
changed: [serverb.lab.example.com]
TASK [Copy secrets file] ********************************************************************************************************************************************************
changed: [serverb.lab.example.com]
TASK [Copy .htaccess] ***********************************************************************************************************************************************************
fatal: [serverb.lab.example.com]: FAILED! => {"changed": false, "checksum": "9257441435578eaa12b97f0185b5fb26b558b622", "msg": "Destination directory /var/www/html does not exist"}
PLAY RECAP **********************************************************************************************************************************************************************
serverb.lab.example.com : ok=5 changed=4 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
--->%
I cannot copy content from the serverb console, but I looked and indeed there is no /var/www/html directory even though `yum info httpd` says the httpd package has been installed.
This problem did not occur the first time I ran this main.yml .
Follow up:
I logged in on the serverb . From `rpm -q --whatprovides /var/www` I learned that it comes from the httpd-filesystem packakes. `yum info httpd-filesystem` says it was installed. `rpm install httpd-filesystem` says it has nothing to do. So I did `rpm reinstall httpd-filesysytem` and that created the /var/www/html/ .
To be continued.
Apparently `lab finish` removes (a.o.) the /var/www/* , but does not remove the httpd-filesystem package, possibly because other packages depend on it So serverb is left in an inconsistent state.
I now managed to run the `lab grade data-review` successfully, so consider this issue solved.
Hello @TPeters !
I see that you have figured out the issue yourself - great !
Let me know if you need any help or you have a question / feedback on this.
@Rogier Do you have a screenshot to check ?
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.