forked from lemzoo/ansible-sample-exam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask10
12 lines (9 loc) · 801 Bytes
/
task10
1
2
3
4
5
6
7
8
9
10
11
12
Task 10: Create and Work with Roles (Some More)
Create a role called sample-apache and store it in /home/automation/plays/roles. The role should satisfy the following requirements:
The httpd, mod_ssl and php packages are installed. Apache service is running and enabled on boot.
Firewall is configured to allow all incoming traffic on HTTP port TCP 80 and HTTPS port TCP 443.
Apache service should be restarted every time the file /var/www/html/index.html is modified.
A Jinja2 template file index.html.j2 is used to create the file /var/www/html/index.html with the following content:
The address of the server is: IPV4ADDRESS
IPV4ADDRESS is the IP address of the managed node.
Create a playbook /home/automation/plays/apache.yml that uses the role and runs on hosts in the webservers host group.