This page was exported from Exams Labs Braindumps [ http://blog.examslabs.com ] Export date:Sun Nov 24 4:39:07 2024 / +0000 GMT ___________________________________________________ Title: Pass Your RedHat Exam with EX294 Exam Dumps (Updated 35 Questions) [Q10-Q26] --------------------------------------------------- Pass Your RedHat Exam with EX294 Exam Dumps (Updated 35 Questions) EX294 Exam Dumps - RedHat Practice Test Questions NEW QUESTION 10Create a file called packages.yml in /home/sandy/ansible to install some packages for the following hosts. On dev, prod and webservers install packages httpd, mod_ssl, and mariadb. On dev only install the development tools package. Also, on dev host update all the packages to the latest.  Option** NOTE 1 a more acceptable answer is likely ‘present’ since it’s not asking to install the latest state: present** NOTE 2 need to update the development node– name: update all packages on development nodeyum:name: ‘*’state: latest  Option** NOTE 1 a more acceptable answer is likely ‘present’ since it’s not asking to install the latest state: present** NOTE 2 need to update the development node– name: update all packages on development nodeyum:name: ‘*’state: latest NEW QUESTION 11Create a role called sample-apache in /home/sandy/ansible/roles that enables and starts httpd, enables and starts the firewall and allows the webserver service. Create a template called index.html.j2 which 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.yml and use the role to serve the index file on webserver hosts.  Option/home/sandy/ansible/roles/sample-apache/tasks/main.yml/home/sandy/ansible/roles/sample-apache/templates/index.html.j2In /home/sandy/ansible/roles/sample-apache/handlers/main.yml  Option/home/sandy/ansible/roles/sample-apache/tasks/main.yml/home/sandy/ansible/roles/sample-apache/templates/index.html.j2In /home/sandy/ansible/roles/sample-apache/handlers/main.yml NEW QUESTION 12Create an empty encrypted file called myvault.yml in /home/sandy/ansible and set the password to notsafepw. Rekey the password to iwejfj2221. ansible-vault create myvault.ymlCreate new password: notsafepw Confirm password: notsafepw ansible-vault rekey myvault.ymlCurrent password: notsafepw New password: iwejfj2221 Confirm password: iwejfj2221NEW QUESTION 13Install and configure ansibleUser 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.comnode2.example.comnode3.example.comnode4.example.comnode5.example.comConfigure 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.  In/home/sandy/ansible/ansible.cfg[defaults]inventory=/home/sandy/ansible/inventoryroles_path=/home/sandy/ansible/rolesremote_user= sandyhost_key_checking=false[privilegeescalation]become=truebecome_user=rootbecome_ask_pass=falseIn /home/sandy/ansible/inventory[dev]node 1 .example.com[test]node2.example.comnode4.example.comnode5 .example.com[webservers:children]prod  In/home/sandy/ansible/ansible.cfg[defaults]inventory=/home/sandy/ansible/inventoryroles_path=/home/sandy/ansible/rolesremote_user= sandyhost_key_checking=false[privilegeescalation]become=truebecome_user=rootbecome_method=sudobecome_ask_pass=falseIn /home/sandy/ansible/inventory[dev]node 1 .example.com[test]node2.example.com[proxy]node3 .example.com[prod]node4.example.comnode5 .example.com[webservers:children]prod NEW QUESTION 14Generate a hosts file:* Download an initial template file hosts.j2 from http://classroom.example.com/hosts.j2 to/home/admin/ansible/ Complete the template so that it can be used to generate a file with a line for each inventory host in the same format as /etc/hosts:172.25.250.9 workstation.lab.example.com workstation* Create a playbook called gen_hosts.yml that uses this template to generate the file /etc/myhosts on hosts in the dev host group.* When completed, the file /etc/myhosts on hosts in the dev host group should have a line for each managed host:127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6172.25.250.10 serevra.lab.example.com servera172.25.250.11 serevrb.lab.example.com serverb172.25.250.12 serevrc.lab.example.com serverc172.25.250.13 serevrd.lab.example.com serverd—————————————————————–while practising you to create these file hear. But in exam have to download as per questation.hosts.j2 file consists.localhost localhost.localdomain localhost4 localhost4.localdomain4::1localhost localhost.localdomain localhost6 localhost6.localdomain6——————————————————————- Solution as:# pwd/home/admin/ansible# wget http://classroom.example.com/hosts.j2# vim hosts.j2127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1localhost localhost.localdomain localhost6 localhost6.localdomain6{% for host in groups[‘all’] %}{{ hostvars[host][‘ansible_facts’][‘default_ipv4’][‘address’] }} {{ hostvars[host][‘ansible_facts’][‘fqdn’] }} {{ hostvars[host][‘ansible_facts’][‘hostname’] }}{% endfor %}:wq!# vim gen_hosts.yml—– name: collecting all host informationhosts: alltasks:– name:template:src: hosts.j2dest: /etc/myhostswhen: inventory_hostname in groups[‘dev’]:wq# ansible-playbook gen_hosts.yml –syntax-check# ansible-playbook gen_hosts.ymlNEW QUESTION 15Create a role called sample-apache in /home/sandy/ansible/roles that enables and starts httpd, enables and starts the firewall and allows the webserver service. Create a template called index.html.j2 which 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.yml and use the role to serve the index file on webserver hosts. /home/sandy/ansible/apache.yml/home/sandy/ansible/roles/sample-apache/tasks/main.yml/home/sandy/ansible/roles/sample-apache/templates/index.html.j2In /home/sandy/ansible/roles/sample-apache/handlers/main.ymlNEW QUESTION 16Create a playbook called timesvnc.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. Solution as:NEW QUESTION 17In /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.  Solution as:  Solution as: NEW QUESTION 18In /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. Solution as:Topic 1, LAB SETUPYou will need to set up your lab by creating 5 managed nodes and one control node.So 6 machines total. Download the free RHEL8 iso from Red Hat Developers website.***Control node you need to set up***You need to create some static ips on your managed nodes then on the control node set them up in the/etc/hosts file as follows:vim /etc/hosts10.0.2.21 node1.example.com10.0.2.22 node2.example.com10.0.2.23 node3.example.com10.0.2.24 node4.example.com10.0.2.25 node5.example.comyum -y install ansibleuseradd ansibleecho password | passwd –stdin ansibleecho “ansible ALL=(ALL) NOPASSWD:ALLsu – ansible; ssh-keygenssh-copy-id node1.example.comssh-copy-id node2.example.comssh-copy-id node3.example.comssh-copy-id node4.example.comssh-copy-id node5.example.com***Each manage node setup***First, add an extra 2GB virtual harddisk to each control node 1,2,3. Then add an extra hard disk to controlnode 4. Do not add an extra hard disk to node 5. When you start up these machines the extra disks should beautomatically located at /dev/sdb (or /dev/vdb depending on your hypervisor).useradd ansibleecho password | passwd –stdin ansibleecho “ansible ALL=(ALL) NOPASSWD:ALL” > /etc/sudoers.d/ansibleNote python3 should be installed by default, however if it is not then on both the control node and managednodes you can install it also set the default python3 if you are having trouble with python2 being the default.yum -y install python3alternatives –set python /usr/bin/python3All machines need the repos available. You did this in RHSCA. To set up locally you just need to do the samefor each machine. Attach the rhel8 iso as a disk to virtualbox, kvm or whatever hypervisor you are using (thiswill be /dev/sr0). Then inside the machine:mount /dev/sr0 to /mntThen you will have all the files from the iso in /mnt.mkdir /repocp -r /mnt /repovim /etc/yum.repos.d/base.repoInside this file:[baseos]name=baseosbaseurl=file:///repo/BaseOSgpgcheck=0Also the appstreamvim /etc/yum.repos.d/appstream.repoInside this file:[appstream]name=appstreambaseurl=file:///repo/AppStreamgpgcheck=0NEW QUESTION 19Create 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  Solution as:  Solution as: NEW QUESTION 20Create a file called adhoc.sh in /home/sandy/ansible which will use adhoc commands to set up a new repository.The name of the repo will be ‘EPEL’ the description ‘RHEL8’ the baseurl is ‘https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.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. chmod 0777 adhoc.shvim adhoc.sh#I/bin/bashansible all -m yum_repository -a ‘name=EPEL description=RHEL8baseurl=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rmpgpgcheck=no enabled=yes’NEW QUESTION 21Create a playbook called webdev.yml in ‘home/sandy/ansible. The playbook will create a directory Avcbdev on dev host. The permission of the directory are 2755 and owner is webdev. Create a symbolic link from /Webdev to /var/www/html/webdev. Serve a file from Avebdev7index.html which displays the text “Development” Curl http://node1.example.com/webdev/index.html to test  Solution as:  Solution as: NEW QUESTION 22Create the users in the file usersjist.yml file provided. Do this in a playbook called users.yml located at /home/sandy/ansible. The passwords for these users should be set using the lock.yml file from TASK7. When running the playbook, the lock.yml file should be unlocked with secret.txt file from TASK 7.All users with the job of ‘developer’ should be created on the dev hosts, add them to the group devops, their password should be set using the pw_dev variable. Likewise create users with the job of ‘manager’ on the proxy host and add the users to the group ‘managers’, their password should be set using the pw_mgr variable.  ansible-playbook users.yml -vault-password-file=secret.txt  ansible-playbook users.yml -vault-password-file=secret.txt NEW QUESTION 23Modify file content.————————Create a playbook called /home/admin/ansible/modify.yml as follows:* The playbook runs on all inventory hosts* The playbook replaces the contents of /etc/issue with a single line of text asfollows:–> On hosts in the dev host group, the line reads: “Development”–> On hosts in the test host group, the line reads: “Test”–> On hosts in the prod host group, the line reads: “Production” Solution as:# pwd/home/admin/ansible# vim modify.yml—– name:hosts: alltasks:– name:copy:content: “Development”dest: /etc/issuewhen: inventory_hostname in groups[‘dev’]– name:copy:content: “Test”dest: /etc/issuewhen: inventory_hostname in groups[‘test’]– name:copy:content: “Production”dest: /etc/issuewhen: inventory_hostname in groups[‘prod’]:wq# ansible-playbook modify.yml –syntax-check# ansible-playbook modify.ymlNEW QUESTION 24Install and configure ansibleUser 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.comnode2.example.comnode3.example.comnode4.example.comnode5.example.comConfigure 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. In/home/sandy/ansible/ansible.cfg[defaults]inventory=/home/sandy/ansible/inventoryroles_path=/home/sandy/ansible/rolesremote_user= sandyhost_key_checking=false[privilegeescalation]become=truebecome_user=rootbecome_method=sudobecome_ask_pass=falseIn /home/sandy/ansible/inventory[dev]node 1 .example.com[test]node2.example.com[proxy]node3 .example.com[prod]node4.example.comnode5 .example.com[webservers:children]prodNEW QUESTION 25Create 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 Solution as:NEW QUESTION 26Install and configure ansibleUser bob 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/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 may be 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.comnode2.example.comnode3.example.comnode4.example.comnode5.example.comConfigure 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.  In/home/sandy/ansible/ansible.cfg[defaults]inventory=/home/sandy/ansible/inventoryroles_path=/home/sandy/ansible/rolesremote_user= sandyhost_key_checking=false[privilegeescalation]become=truebecome_user=rootbecome_method=sudobecome_ask_pass=falseIn /home/sandy/ansible/inventory[dev]node 1 .example.com[test]node2.example.com[proxy]node3 .example.com[prod]node4.example.comnode5 .example.com[webservers:children]Prod  In/home/sandy/ansible/ansible.cfg[defaults]inventory=/home/sandy/ansible/inventoryroles_path=/home/sandy/ansible/rolesremote_user= sandyhost_key_checking=false[privilegeescalation]become=truebecome_user=rootIn /home/sandy/ansible/inventory[dev]node 1 .example.com[test]node2.example.com[proxy]node3 .example.com[prod]node4.example.comnode5 .example.com[webservers:children]prod  Loading … Pass Your EX294 Exam Easily with Accurate PDF Questions: https://www.examslabs.com/RedHat/RHCE/best-EX294-exam-dumps.html --------------------------------------------------- Images: https://blog.examslabs.com/wp-content/plugins/watu/loading.gif https://blog.examslabs.com/wp-content/plugins/watu/loading.gif --------------------------------------------------- --------------------------------------------------- Post date: 2022-10-28 16:12:03 Post date GMT: 2022-10-28 16:12:03 Post modified date: 2022-10-28 16:12:03 Post modified date GMT: 2022-10-28 16:12:03