Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

RedHat Exam EX294 Topic 8 Question 47 Discussion

Actual exam question for RedHat's EX294 exam
Question #: 47
Topic #: 8
[All EX294 Questions]

Create a role called sample-apache in /home/sandy/ansible/roles that enables and starts httpd, enables and starts the firewall and allows the webserver service. Create a template called index.html.j2 which creates and serves a message from /var/www/html/index.html Whenever the content of the file changes, restart the webserver service.

Welcome to [FQDN] on [IP]

Replace the FQDN with the fully qualified domain name and IP with the ip address of the node using ansible facts. Lastly, create a playbook in /home/sandy/ansible/ called apache.yml and use the role to serve the index file on webserver hosts.

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Avery
26 days ago
This is a solid solution. The only thing I'd add is a comment in the index.html.j2 template to explain the use of the Ansible facts. Keeps it readable for future maintainers.
upvoted 0 times
Ty
15 days ago
I agree, documentation is key for maintaining code in the long run.
upvoted 0 times
...
Sheron
20 days ago
That's a good point, adding a comment for future maintainers is always helpful.
upvoted 0 times
...
...
Stephane
1 months ago
Haha, I wonder if the FQDN and IP address will actually match the node's details. Better double-check that Ansible fact usage!
upvoted 0 times
Tamala
2 days ago
User 3: The playbook and role setup looks good though.
upvoted 0 times
...
Peggy
26 days ago
User 2: Yeah, we should double-check the Ansible facts.
upvoted 0 times
...
Levi
1 months ago
User 1: I hope the FQDN and IP address match the node's details.
upvoted 0 times
...
...
William
1 months ago
Hold on, does the firewall really need to be enabled and started? Seems like an unnecessary step for a simple web server setup.
upvoted 0 times
...
Trina
2 months ago
I feel confident about it, I have practiced similar tasks before.
upvoted 0 times
...
Brent
2 months ago
Looks good! The role and playbook seem well-structured, and the template for the index.html file looks perfect. Can't wait to see it in action!
upvoted 0 times
Xuan
1 months ago
User 2: I'm excited to see it work too. The template for the index.html file looks great!
upvoted 0 times
...
Shelton
1 months ago
User 1: Thanks! I spent some time making sure everything was set up correctly.
upvoted 0 times
...
...
Destiny
2 months ago
I agree, setting up all those tasks in ansible roles can be tricky.
upvoted 0 times
...
Shanda
2 months ago
I think this question is quite challenging.
upvoted 0 times
...

Save Cancel