New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

RedHat EX294 Exam - Topic 9 Question 44 Discussion

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

Create a playbook /home/bob /ansible/motd.yml that runs on all inventory hosts and docs the following: The playbook should replaee any existing content of/etc/motd in the following text. Use ansible facts to display the FQDN of each host

On hosts in the dev host group the line should be "Welcome to Dev Server FQDN".

On hosts in the webserver host group the line should be "Welcome to Apache Server FQDN".

On hosts in the database host group the line should be "Welcome to MySQL Server FQDN".

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Chandra
3 months ago
What if a host isn't in any of those groups? Would it just skip?
upvoted 0 times
...
Jacquelyne
3 months ago
I think it should be straightforward if you set the inventory groups correctly.
upvoted 0 times
...
Aretha
3 months ago
Wait, does it really use ansible facts for FQDN? Sounds tricky.
upvoted 0 times
...
Rhea
4 months ago
Totally agree, that's the easiest way to do it!
upvoted 0 times
...
Sherly
4 months ago
Just use the `lineinfile` module to replace the MOTD.
upvoted 0 times
...
Santos
4 months ago
I remember we had to create a playbook that modified files before, but I can't recall if we need to specify the path to the MOTD file directly in the task.
upvoted 0 times
...
Sommer
4 months ago
I’m a bit confused about the conditionals for different host groups. Do we use `when` statements for that?
upvoted 0 times
...
Beckie
4 months ago
I practiced a similar question where we had to use Ansible facts, so I think we can access the FQDN with `ansible_fqdn`, right?
upvoted 0 times
...
Anglea
5 months ago
I think I remember we need to use the `template` module to replace the MOTD content, but I'm not entirely sure how to reference the FQDN correctly.
upvoted 0 times
...
Wilson
5 months ago
No problem, I've done similar tasks before. I'll create the playbook, use the `ansible_facts` to get the FQDN, and then use `when` clauses to set the MOTD message based on the host group.
upvoted 0 times
...
Carrol
5 months ago
This looks straightforward enough, but I want to make sure I don't accidentally overwrite any important information in the MOTD file. I'll double-check my work and test the playbook on a non-production system first.
upvoted 0 times
...
Janet
5 months ago
Hmm, I'm a bit confused about the host groups mentioned in the question. I'll need to make sure I have the correct group names and that my inventory is set up properly to target those groups.
upvoted 0 times
...
Mose
5 months ago
This looks like a straightforward Ansible playbook task. I'll need to create the playbook file in the specified location, use the appropriate Ansible facts to get the FQDN, and then set the message of the day (MOTD) based on the host group.
upvoted 0 times
...
Devorah
5 months ago
Okay, I think I've got a handle on this. I'll use the `lineinfile` module to replace the existing MOTD content, and then use conditional logic based on the host group to set the appropriate message.
upvoted 0 times
...
Roxane
5 months ago
I've got it! We need to create the new Windows domain, rename the LAW1 domain to NetWare, and then add the Windows 2000 servers to the Windows domain. Simple as that. This should give us the clean separation we're looking for.
upvoted 0 times
...
Stefania
5 months ago
This is a good question. I'm pretty confident I know the answer, but I'll double-check my understanding just to be sure. Backward compatibility is crucial when dealing with custom code, so I'll need to carefully evaluate each option.
upvoted 0 times
...
Evangelina
5 months ago
This is a good question to test our understanding of RDS instance management. I think I have a good handle on the common issues that can cause API calls to fail, so I'll carefully consider each of the options provided.
upvoted 0 times
...
Keshia
10 months ago
Wait, so we're supposed to create a playbook to manage the message of the day? Sounds like a real party trick for the sysadmins!
upvoted 0 times
Cortney
9 months ago
Using ansible facts to display the FQDN adds a nice touch to the playbook.
upvoted 0 times
...
Levi
9 months ago
It's a cool way to personalize the welcome message based on the type of server.
upvoted 0 times
...
Carylon
10 months ago
Yes, we need to create a playbook to manage the message of the day on different host groups.
upvoted 0 times
...
...
Katina
10 months ago
I'm pretty sure the correct answer is not going to be found in the 'sample-apache' tasks file. Let's focus on the actual task at hand.
upvoted 0 times
Lashandra
9 months ago
Let's make sure the line in the motd file is correct for each host group.
upvoted 0 times
...
Kallie
9 months ago
We can use ansible facts to display the FQDN of each host.
upvoted 0 times
...
Alpha
9 months ago
Yes, we need to replace the content of /etc/motd with the correct text for each host group.
upvoted 0 times
...
Lang
9 months ago
I think we should focus on the playbook in /home/bob/ansible/motd.yml.
upvoted 0 times
...
...
Cortney
10 months ago
Haha, the question is about Ansible and /etc/motd, not about Apache! Someone's a bit confused here.
upvoted 0 times
...
Mi
10 months ago
The question is clear, it asks to create a playbook that updates the /etc/motd file with different messages based on the host group. The answer options are not addressing the actual question.
upvoted 0 times
Brittni
10 months ago
Yes, and we should replace the existing content of /etc/motd with specific messages for each host group.
upvoted 0 times
...
Maybelle
10 months ago
I think we need to use ansible facts to display the FQDN of each host.
upvoted 0 times
...
...
Madalyn
11 months ago
I believe we should create separate tasks for each host group in the playbook.
upvoted 0 times
...
Chau
11 months ago
The question is asking for a playbook named 'motd.yml' that runs on all inventory hosts, not 'apache.yml'. The code provided is not relevant.
upvoted 0 times
Ilona
10 months ago
Make sure the playbook is named 'motd.yml' and is located in /home/bob/ansible/
upvoted 0 times
...
Herman
10 months ago
The line should say 'Welcome to Dev Server FQDN' on dev hosts, 'Welcome to Apache Server FQDN' on webserver hosts, and 'Welcome to MySQL Server FQDN' on database hosts.
upvoted 0 times
...
Marcos
10 months ago
Yes, it should display the FQDN of each host using ansible facts.
upvoted 0 times
...
Tammy
10 months ago
I think the playbook should replace the content of /etc/motd with the specified text based on the host group.
upvoted 0 times
...
...
Eve
11 months ago
I agree, we need to use ansible facts to display the FQDN of each host.
upvoted 0 times
...
Madalyn
11 months ago
I think this question is challenging.
upvoted 0 times
...

Save Cancel