So I went thru the instructor's video and did what he said....used import_tasks instead of ansible,builtin.import_tasks in PLAYBOOK.YML and it succeeded.
SUCCESS !!!!!
@zak1 -
Actually the ansible,builtin.import_tasks should have worked. However, your problem was more fundamental in that you accidentally mixed things up in the solution. The import_tasks is meant to be used in a playbook to import a list of tasks. From what I can tell, you did have an import_tasks for the server setup, but there were no tasks imported for the Firewall setup which means while everything is up and running you couldn't connect properly and return content.
So this image has the HTTPD Server installation only
So that would be the imported tasks for installing the Apache webserver and setting up the firewall rules. I see nothing from your original above that opened up the firewall rules. I have a feeling since the grading occurs from workstation it was unable to connect and being blocked by the firewall. One way you could have checked was go to the ServerX individually and doing a curl localhost. My guess is when you went back and changed things how the instructor did things that you had created the correct firewall rules and imported the firewall tasks which allowed the grading to pass. Technically, the import_tasks is the same as ansible.builtin.import_tasks as it is part of the Ansible core collection of modules. It is generally best practice to use the fully-qualified collection name (FQCN) even for built-in collections and modules but instructors (like myself) often don't do that because of bad habits. I strive to always show FQCN, but I am horrible for some things (especially debug module).
Thank you for your question.
From your description, we can conclude the following:
Based on these observations, it’s possible that the HTTP service on all web servers is unable to read or serve the intended web content. This may be related to a configuration issue in the web_tasks.yml playbook described in Chapter 6, Section 6.5 of the lab.
Specifically, check the section using ansible.builtin.copy. Ensure that all file paths, permissions, and ownerships are correctly defined to allow the web server to access and serve the files.
If this doesn’t resolve your issue or if you need further assistance, please feel free to reach out again.
Thanks, Yamato stll going crazy here..... here's the web_tasks.yml. Please help:
Thank you for providing additional details.
At first glance, it appears there may be an issue with the module referenced in the sections highlighted in red. Additionally, the green-highlighted portion also seems to differ from what is expected.
Could you start by correcting these two areas and let us know if the issue persists?
I made it same as in the picture u showed on the right BUT the issue remains:
Hi @zak1
Thank you very much reply us.
Could you share us the latest error message after you run the play?
So I went thru the instructor's video and did what he said....used import_tasks instead of ansible,builtin.import_tasks in PLAYBOOK.YML and it succeeded.
SUCCESS !!!!!
Congratulations, @zak1
@zak1 -
Actually the ansible,builtin.import_tasks should have worked. However, your problem was more fundamental in that you accidentally mixed things up in the solution. The import_tasks is meant to be used in a playbook to import a list of tasks. From what I can tell, you did have an import_tasks for the server setup, but there were no tasks imported for the Firewall setup which means while everything is up and running you couldn't connect properly and return content.
So this image has the HTTPD Server installation only
So that would be the imported tasks for installing the Apache webserver and setting up the firewall rules. I see nothing from your original above that opened up the firewall rules. I have a feeling since the grading occurs from workstation it was unable to connect and being blocked by the firewall. One way you could have checked was go to the ServerX individually and doing a curl localhost. My guess is when you went back and changed things how the instructor did things that you had created the correct firewall rules and imported the firewall tasks which allowed the grading to pass. Technically, the import_tasks is the same as ansible.builtin.import_tasks as it is part of the Ansible core collection of modules. It is generally best practice to use the fully-qualified collection name (FQCN) even for built-in collections and modules but instructors (like myself) often don't do that because of bad habits. I strive to always show FQCN, but I am horrible for some things (especially debug module).
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.