Question: 1
Create a playbook /home/sandy/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'.
Answer : A
Show Answer
Hide Answer
Question: 2
In /home/sandy/ansible/ create a playbook called logvol.yml. In the play create a logical volume called Iv0 and make it of size 1500MiB on volume group vgO If there is not enough space in the volume group print a message 'Not enough space for logical volume' and then make a 800MiB Iv0 instead. If the volume group still doesn't exist, create a message 'Volume group doesn't exist' Create an xfs filesystem on all Iv0 logical volumes. Don't mount the logical volume.
Answer : A
Show Answer
Hide Answer
Question: 3
Create a file called specs.empty in home/sandy/ansible on the local machine as follows:
HOST=
MEMORY=
BIOS=
VDA_DISK_SIZE=
VDB_DISK_SIZE=
Create the playbook /home/sandy/ansible/specs.yml which copies specs.empty to all remote nodes' path /root/specs.txt. Using the specs.yml playbook then edit specs.txt on the remote machines to reflect the appropriate ansible facts.
Answer : A
Show Answer
Hide Answer
Question: 4
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/ansible called hosts.yml and install the template on dev node at /root/myhosts
Answer : A
Show Answer
Hide Answer
Question: 5
Install and configure ansible
User sandy has 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/sandy/ansible/ansible.cfg to meet the following requirements:
* The roles path should include /home/sandy/ansible/roles, as well as any other path that may be required for the course of the sample exam.
* The inventory file path is /home/sandyansible/inventory.
* Ansible should be able to manage 10 hosts at a single time.
* Ansible should connect to all managed nodes using the sandy user.
Create an inventory file for the following five nodes:
Configure these nodes to be in an inventory file where node1 is a member of group dev. nodc2 is a member of group test, nodc3 is a member of group proxy, nodc4 and node 5 are members of group prod. Also, prod is a member of group webservers.
A Explanation:
In/home/sandy/ansible/ansible.cfg
[defaults]
inventory=/home/sandy/ansible/inventory
roles_path=/home/sandy/ansible/roles
remote_user= sandy
host_key_checking=false
[privilegeescalation]
become=true
become_user=root
become_method=sudo
become_ask_pass=false
In /home/sandy/ansible/inventory
[dev]
node 1 .example.com
[test]
node2.example.com
[proxy]
node3 .example.com
[prod]
node4.example.com
node5 .example.com
[webservers:children]
prod
Answer : A
Show Answer
Hide Answer