Create a role called apache in "/home/admin/ansible/roles" with the following
requirements:
--> The httpd package is installed, enabled on boot, and started.
--> The firewall is enabled and running with a rule to allow access to the web server.
--> template file index.html.j2 is used to create the file /var/www/html/index.html
with the output:
Welcome to HOSTNAME on IPADDRESS
--> Where HOSTNAME is the fqdn of the managed node and IPADDRESS is the IP-Address of
the managed node.
note: you have to create index.html.j2 file.
--> Create a playbook called httpd.yml that uses this role and the playbook runs on
hosts in the webservers host group.
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
33 comments · newest first
CO
Corazon
11 months ago
I’m not sure about using `latest` for packages, could cause issues.
RE
Reta
12 months ago
Nice template setup! Simple and effective.
DE
Detra
12 months ago
Wait, is firewalld the default on all systems?
MI
Mirta
1 year ago
Totally agree, firewall is crucial for security.
DI
Dierdre
1 year ago
Looks good, but don't forget to check the firewall rules!
RE
Remona
1 year ago
I hope I remember to use the correct variables in the `index.html.j2` file; I think it was something like `{{ ansible_facts.fqdn }}` for the hostname.
JU
Judy
1 year ago
I feel confident about the playbook structure, but I might mix up the tasks for starting services and enabling them on boot.
KA
Karol
1 year ago
I think we did a similar question where we had to set up a web server, but I can't recall if we used the `firewalld` module or something else.
LE
Leana
1 year ago
I remember we practiced creating roles, but I'm a bit unsure about the exact syntax for the template file.
JE
Jerry
1 year ago
I think I've got a good handle on this. The key will be to take it step-by-step, test each piece as I go, and make sure the playbook runs without any syntax errors. Can't wait to see the final result!
RE
Reyes
1 year ago
This looks like a good opportunity to practice using Ansible's import_tasks functionality to keep my main.yml file clean and modular. I'll make sure to create separate task files for each logical component.
SA
Sabra
1 year ago
Ah, the template file for the index.html is a nice touch. I'll need to make sure I get the variable substitution right for the hostname and IP address. Shouldn't be too difficult, but I'll double-check the Jinja2 syntax.
EU
Eun
1 year ago
This looks like a pretty straightforward task. I think I can handle this by creating the role structure, defining the variables, and then building out the tasks to install the packages, configure the services, and generate the index.html file.
FL
Florinda
1 year ago
Hmm, I'm a bit unsure about the firewall configuration. Do I need to create a separate task for that or can I just include it in the service tasks? I'll need to review the firewall module documentation to make sure I'm doing that correctly.
RI
Ricki
1 year ago
I'm pretty confident that the correct answer is D. Motivation seems like the key factor that would affect an individual's trainability.
IS
Isaac
1 year ago
This seems straightforward. I think the key is to ensure Reply Mail Management is enabled and then configure the unsubscribe settings.
LE
Leslee
1 year ago
Group-level stickiness seems relevant, but I could be mixing it up with configuration options from another practice question.
HU
Huey
2 years ago
Definitely, running syntax check and testing the URL is crucial.
EV
Evan
2 years ago
Good point! It's easy to overlook.
LA
Laila
2 years ago
Makes creating the structure easier.
EV
Evelynn
2 years ago
True, firewalld can be tricky.
HO
Holley
3 years ago
Yeah, but don't forget creating the template file!
AI
Aide
3 years ago
Right? So many steps to remember.
SH
Sherell
3 years ago
I included the apache role in the playbook and added tasks for pre and post checks.
GE
Georgiana
3 years ago
Make sure the playbook runs on hosts in the webservers host group.
AR
Armanda
3 years ago
Great, now you need to create the httpd.yml playbook.
SH
Sherell
3 years ago
Yes, the index.html file has the output 'Welcome to HOSTNAME on IPADDRESS'.
GE
Georgiana
3 years ago
Did you create the index.html file with the correct template?
SH
Sherell
3 years ago
I enabled and started the firewall with the rule.
AR
Armanda
3 years ago
Don't forget to add the firewall rule to allow access to the web server.
SH
Sherell
3 years ago
Yes, I also started the httpd service.
GE
Georgiana
3 years ago
Did you make sure the httpd package is installed and enabled on boot?
SH
Sherell
3 years ago
I just created the apache role in /home/admin/ansible/roles.