Create a role called sample-apache and store it in /home/bob/ansible/roles. The role should
satisfy the following requirements:
*In the role, install and enable httpd. Also enable the firewall to allow http. Also run the template
*index.html.j2 and make sure this runs Create a template index.html.j2 that displays "Welcome to the server HOSTNAME"
In a play called apache.yml in /home/bob/ansible/ run the sample-apache role.
Create a playbook /home/bob /ansible/motd.yml that runs on all inventory hosts and docs the following:
1.
The playbook should replaee any existing content of/etc/motd in the following text.
2.
Use ansible facts to display the FQDN of each host
3.
On hosts in the dev host group the line should be "Welcome to Dev Server FQDN".
4.
On hosts in the webserver host group the line should be "Welcome to Apache Server FQDN".
5.
On hosts in the database host group the line should be "Welcome to MySQL Server FQDN".
What does the lineinfile module do?
A. Allow addition of lines anywhere in a file
B. Allows to grep for lines in a provided file
C. Allow additions of lines to the end of a file only
D. Input data into a file from stdin
Which Ansible ad-hoc flag is analogous to the become directive?
A. b
B. f
C. i
D. B
What is wrong with the following command: ansible all -a "mkdir/tmp/testfile"
A. There is not a module specified.
B. There is not an inventory file specified.
C. The command will execute without error.
D. The -b flag is required.
What is the defaults directory used for within a role?
A. The defaults directory is for defining default values for variables if no other value is provided.
B. The defaults directory is where you define which plays of a role will be used by default.
C. The defaults directory is for defining variable values that override other variables used in a playbook using the role.
D. The defaults directory stores configurations that override ansible.cfg.
What is the url for the official Ansible online documentation?
A. docs.ansible.com
B. help.ansible.com
C. google.com
D. ansiblehelp.com
State whether the following statement is true or false. Ansible expects templates to use json format.
A. True
B. False
State whether the following statement is true or false.
The command ansible-galaxy init won't create the file structure you need for roles.
A. True
B. False
State whether the following statement is true or false.
A template can only use 1 variable.
A. True
B. False