CORRECT TEXT Create an ansible vault password file calledlock.ymlwith the passwordreallysafepwin the /home/sandy/ansibledirectory. In the lock.yml file define two variables. One ispw_devand the password is 'dev' and the other ispw_mgrand the password is 'mgr' Create a regular file calledsecret.txtwhich contains the password for lock.yml.
A. See the for complete Solution below.
CORRECT TEXT
Create a jinja template in /home/sandy/ansible/ and name it hosts.j2. Edit this file so it looks like the one below. The order of the nodes doesn't matter. Then create a playbook in /home/sandy/ansiblecalledhosts.ymland install the template on dev node at /root/myhosts
A. See the for complete Solution below.
CORRECT TEXT
Create a file calledrequirements.ymlin/home/sandy/ansible/rolesa file calledrole.yml in /home/sandy/ansible/.Thehaproxy-roleshould be used on theproxyhost. And when you curlhttp://node3.example.comit should display "Welcome tonode4.example.com" and when you curl again "Welcome tonode5.example.com" Thephp-roleshould be used on theprod host.
A. See the for complete Solution below.
CORRECT TEXT
Create a playbook called regulartasks.yml which has the system that append the date to /root/datefile every day at noon. Name is job 'datejob'
A. See the for complete Solution below.
CORRECT TEXT
Create a role called sample-apache in/home/sandy/ansible/rolesthat enables and starts httpd, enables and starts the firewall and allows the webserver service. Create a template calledindex.html.j2which creates and serves a message from/
var/www/html/index.html Whenever the content of the file changes, restart the webserver service.
Welcome to [FQDN] on [IP]
Replace the FQDN with the fully qualified domain name and IP with the ip address of the node using ansible facts. Lastly, create a playbook in/home/sandy/ansible/called apache.ymland use the role to serve the index file on webserver hosts.
A. See the for complete Solution below.
CORRECT TEXT
Install and configure ansible
Userbobhas been created on your control node. Give him the appropriate permissions on the control node.Install the necessary packages to run ansible on the control node.
Create a configuration file /home/bob/ansible/ansible.cfg to meet the following requirements:
The roles path should include /home/bob/ansible/roles, as well as any other path that maybe required for the course of the sample exam.
The inventory file path is /home/bob/ansible/inventory.
Ansible should be able to manage 10 hosts at a single time.
Ansible should connect to all managed nodes using the bob user.
Create an inventory file for the following five nodes:
nodel.example.com
node2.example.com
node3.example.com
node4.example.com
node5.example.com
Configure these nodes to be in an inventory file where node1 is a member of groupdev. nodc2 is a member of group test, nodc3 is a member of groupproxy,nodc4 and node 5 are members of groupprod.Also,prodis a member of group
webservers.
A. See the for complete Solution below.
CORRECT TEXT
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.j2that displays "Welcome to the server HOSTNAME"
In a play called apache.yml in /home/bob/ansible/ run the sample-apache role.
A. See the for complete Solution below.
CORRECT TEXT
Create a playbookthatchanges the default target onallnodes tomulti-usertarqet. Do this in playbook file called target.yml in /home/sandy/ansible
A. See the for complete Solution below.
CORRECT TEXT
Create a file in/home/sandy/ansible/calledreport.yml.Using this playbook, get a filecalled report.txt(make it look exactly as below). Copy this file over to all remote hosts at /root/report.txt.Then edit the lines in the file to provide the real informationofthehosts. Ifa disk does not exist then write NONE.
A. See the for complete Solution below.
CORRECT TEXT
Using the Simulation Program,perform the following tasks:
1.
Use an ansible ad-hoc command, check the connectivity of your servers.
2.
Use an ad-hoc ansible command, find the free space of your servers.
3.
Use an ad-hoc ansible command, find out the memory usage of your servers.
4.
Do an ls -l on the targets /var/log/messages file.
5.
Tail the contents of the targets /var/log/messages file.
A. See the for complete Solution below.