Question 21
Create a file in /home/sandy/ansible/ called report.yml. Using this playbook, get a file called 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 information a disk does not exist then write NONE.


Question 22
State whether the following statement is true or false.
The following command can be used to filter facts to pull out the ip address for the target host.
ansible local -m setup -a "filter=ansible_default_ipv4"
The following command can be used to filter facts to pull out the ip address for the target host.
ansible local -m setup -a "filter=ansible_default_ipv4"
Question 23
Install and configure ansible
User sandy has been created on your control node with the appropriate permissions already, do not change or modify ssh keys. Install the necessary packages to run ansible on the control node. Configure ansible.cfg to be in folder /home/sandy/ansible/ansible.cfg and configure to access remote machines via the sandy user. All roles should be in the path /home/sandy/ansible/roles. The inventory path should be in
/home/sandy/ansible/invenlory.
You will have access to 5 nodes.
node1.example.com
node2.example.com
node3.example.com
node4.example.com
node5.example.com
Configure these nodes to be in an inventory file where node I is a member of group dev. nodc2 is a member of group test, node3 is a member of group proxy, nodc4 and node 5 are members of group prod. Also, prod is a member of group webservers.
User sandy has been created on your control node with the appropriate permissions already, do not change or modify ssh keys. Install the necessary packages to run ansible on the control node. Configure ansible.cfg to be in folder /home/sandy/ansible/ansible.cfg and configure to access remote machines via the sandy user. All roles should be in the path /home/sandy/ansible/roles. The inventory path should be in
/home/sandy/ansible/invenlory.
You will have access to 5 nodes.
node1.example.com
node2.example.com
node3.example.com
node4.example.com
node5.example.com
Configure these nodes to be in an inventory file where node I is a member of group dev. nodc2 is a member of group test, node3 is a member of group proxy, nodc4 and node 5 are members of group prod. Also, prod is a member of group webservers.
Question 24
You are taking over for someone while they are away on leave. You need to run a playbook against over
600 servers. When you run the playbook you notice that only 10 servers are worked on at any one time.
How would you fix this so that you can have 50 servers worked on at the same time?
600 servers. When you run the playbook you notice that only 10 servers are worked on at any one time.
How would you fix this so that you can have 50 servers worked on at the same time?
Question 25
State whether the following statement is true or false.
The following is allowed in a playbook.
---
-
tasks:
yaml:
name=yum.
- hosts: local
The following is allowed in a playbook.
---
-
tasks:
yaml:
name=yum.
- hosts: local