CORRECT TEXT
Create a file calledadhoc.shin/home/sandy/ansiblewhich will use adhoc commands to set up anew repository. The name of the repo will be 'EPEL' the description 'RHEL8' the baseurl is'https://dl.fedoraproject.org/pub/epel/epel-release-latest8.noarch.rmp'there is no gpgcheck, but you should enable the repo.
*
You should be able to use an bash script using adhoc commands to enable repos. Depending on your lab setup, you may need to make this repo "state=absent" after you pass this task.
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
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 playbook called issue.yml in /home/sandy/ansible which changes the file /etc/issue on all managed nodes: If host is a member of (lev then write "Development" If host is a member oftestthen write "Test" If host is a member ofprodthen write "Production"
A. See the for complete Solution below.
CORRECT TEXT
Using the Simulation Program, perform the following tasks:
Ad-Hoc Ansible Commands (Number Two) Task:
1.Use the ad-hoc command to make sure php is installed.
2.
Use the ad-hoc command to make sure that php is installed and is the latest version.
3.
Use the ad-hoc command to make sure that httpd is installed.
4.
Use the ad-hoc command to remove httpd fromthe servers.
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
In /home/sandy/ansible/create a playbook calledlogvol.yml. Inthe play create a logical volume calledIv0and make it of size 1500MiB on volume groupvgOIf there is not enough space in the volume groupprinta message"Not enough space for logical volume"and then make a 800MiBIv0instead. If the volume group still doesn't exist, create a message "Volume group doesn't exist"Create anxfsfilesystem on allIv0logical volumes. Don't mount the logical volume.
A. See the for complete Solution below.
CORRECT TEXT
Create a playbook calledtimesvnc.yml in /home/sandy/ansible using rhel system role timesync. Set the time to use currently configured nip with the server 0.uk.pool.ntp.org. Enable burst. Do this on all hosts.
A. See the for complete Solution below.