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 EX294 Exam - Topic 9 Question 44 Discussion

Posted by Rebeca on May 11, 2024 at 05:06 AM

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".

Suggested Answer: A

Get Premium EX294 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
38 comments · newest first
CH
Chandra 11 months ago
What if a host isn't in any of those groups? Would it just skip?
JA
Jacquelyne 12 months ago
I think it should be straightforward if you set the inventory groups correctly.
AR
Aretha 12 months ago
Wait, does it really use ansible facts for FQDN? Sounds tricky.
RH
Rhea 1 year ago
Totally agree, that's the easiest way to do it!
SH
Sherly 1 year ago
Just use the `lineinfile` module to replace the MOTD.
SA
Santos 1 year 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.
SO
Sommer 1 year ago
I’m a bit confused about the conditionals for different host groups. Do we use `when` statements for that?
BE
Beckie 1 year 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?
AN
Anglea 1 year 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.
WI
Wilson 1 year 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.
CA
Carrol 1 year 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.
JA
Janet 1 year 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.
MO
Mose 1 year 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.
DE
Devorah 1 year 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.
RO
Roxane 1 year 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.
ST
Stefania 1 year 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.
EV
Evangelina 1 year 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.
KE
Keshia 2 years 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!
CO
Cortney 1 year ago
↳ replying to Keshia
Using ansible facts to display the FQDN adds a nice touch to the playbook.
LE
Levi 1 year ago
↳ replying to Keshia
It's a cool way to personalize the welcome message based on the type of server.
CA
Carylon 2 years ago
↳ replying to Keshia
Yes, we need to create a playbook to manage the message of the day on different host groups.
KA
Katina 2 years 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.
LA
Lashandra 1 year ago
↳ replying to Katina
Let's make sure the line in the motd file is correct for each host group.
KA
Kallie 1 year ago
↳ replying to Katina
We can use ansible facts to display the FQDN of each host.
AL
Alpha 1 year ago
↳ replying to Katina
Yes, we need to replace the content of /etc/motd with the correct text for each host group.
LA
Lang 1 year ago
↳ replying to Katina
I think we should focus on the playbook in /home/bob/ansible/motd.yml.
CO
Cortney 2 years ago
Haha, the question is about Ansible and /etc/motd, not about Apache! Someone's a bit confused here.
MI
Mi 2 years 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.
BR
Brittni 2 years ago
↳ replying to Mi
Yes, and we should replace the existing content of /etc/motd with specific messages for each host group.
MA
Maybelle 2 years ago
↳ replying to Mi
I think we need to use ansible facts to display the FQDN of each host.
MA
Madalyn 2 years ago
I believe we should create separate tasks for each host group in the playbook.
CH
Chau 2 years 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.
IL
Ilona 2 years ago
↳ replying to Chau
Make sure the playbook is named 'motd.yml' and is located in /home/bob/ansible/
HE
Herman 2 years ago
↳ replying to Chau
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.
MA
Marcos 2 years ago
↳ replying to Chau
Yes, it should display the FQDN of each host using ansible facts.
TA
Tammy 2 years ago
↳ replying to Chau
I think the playbook should replace the content of /etc/motd with the specified text based on the host group.
EV
Eve 2 years ago
I agree, we need to use ansible facts to display the FQDN of each host.
MA
Madalyn 2 years ago
I think this question is challenging.
0/2000 characters

Save Cancel