This page was exported from Free valid test braindumps [ http://free.validbraindumps.com ] Export date:Sat Apr 5 1:16:54 2025 / +0000 GMT ___________________________________________________ Title: EX294 Dumps 2023 New RedHat EX294 Exam Questions [Q15-Q37] --------------------------------------------------- EX294 Dumps 2023 - New RedHat EX294 Exam Questions Free EX294 braindumps download (EX294 exam dumps Free Updated) Total Cost for the RedHat EX294 Certification Exam: The cost of this RedHat EX294 Certification Exam is $400.   Q15. Create 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’Q16. 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’ Solution as:Q17. Create 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 Q18. 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. 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=0Q19. Modify 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.ymlQ20. Install 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]prodQ21. Generate 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.ymlQ22. 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 of the hosts. If a disk does not exist then write NONE. Solution as:Q23. Create an ansible vault password file called lock.yml with the password reallysafepw in the /home/sandy/ansible directory. In the lock.yml file define two variables. One is pw_dev and the password is ‘dev’ and the other is pw_mgr and the password is ‘mgr’ Create a regular file called secret.txt which contains the password for lock.yml.  ansible-vault create lock.ymlNew Vault Password: reallysafepwConfirm: reallysafepw  ansible-vault create lock.ymlNew Vault Password: reallysafepw Q24. Create 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:  Solution as: Q25. Create 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:Q26. Create user accounts————————–> A list of users to be created can be found in the file called user_list.ymlwhich you should download from http://classroom.example.com/user_list.yml andsave to /home/admin/ansible/–> Using the password vault created elsewhere in this exam, create a playbook calledcreate_user.ymlthat creates user accounts as follows:–> Users with a job description of developer should be:–> created on managed nodes in the “dev” and “test” host groups assigned thepassword from the “dev_pass”variable and these user should be member of supplementary group “devops”.–> Users with a job description of manager should be:–> created on managed nodes in the “prod” host group assigned the password fromthe “mgr_pass” variableand these user should be member of supplementary group “opsmgr”–> Passwords should use the “SHA512” hash format. Your playbook should work usingthe vault password filecreated elsewhere in this exam.while practising you to create these file hear. But in exam have to download as perquestation.user_list.yml file consist:—user:– name: user1job: developer– name: user2job: manager Solution as:# pwd/home/admin/ansible# wget http://classroom.example.com/user_list.yml# cat user_list.yml# vim create_user.yml—– name:hosts: allvars_files:– ./user_list.yml– ./vault.ymltasks:– name: creating groupsgroup:name: “{{ item }}”state: presentloop:– devops– opsmgr– name: creating useruser:name: “{{ item.name }}”state: presentgroups: devopspassword: “{{ dev_pass|password_hash (‘sha512’) }}”loop: “{{ user }}”when: (inventory_hostname in groups[‘dev’] or inventory_hostname ingroups[‘test’]) and item.job == “developer”– name: creating useruser:name: “{{ item.name }}”state: presentgroups: opsmgrpassword: “{{ mgr_pass|password_hash (‘sha512’) }}”loop: “{{ user }}”when: inventory_hostname in groups[‘prod’] and item.job == “manager”:wq!# ansible-playbook create_user.yml –vault-password-file=password.txt –syntax-check# ansible-playbook create_user.yml –vault-password-file=password.txtQ27. Use Ansible Galaxy with a requirements file called /home/admin/ansible/roles/install.yml to download and install roles to /home/admin/ansible/roles from thefollowing URLs:http:// classroom.example.com /role1.tar.gz The name of this role should be balancerhttp:// classroom.example.com /role2.tar.gz The name of this role should be phphello Solution as:# pwd/home/admin/ansible/roles# vim install.yml—– src: http://classroom.example.com/role1.tar.gzname: balancer– src: http://classroom.example.com/role2.tar.gzname: phphello:wq!# pwd/home/admin/ansible# ansible-galaxy install -r roles/install.yml -p rolesQ28. Create a playbook called web.yml as follows:* The playbook runs on managed nodes in the “dev” host group* Create the directory /webdev with the following requirements:–> membership in the apache group–> regular permissions: owner=r+w+execute, group=r+w+execute, other=r+executes.p=set group-id* Symbolically link /var/www/html/webdev to /webdev* Create the file /webdev/index.html with a single line of text that reads:“Development”–> it should be available on http://servera.lab.example.com/webdev/index.html Solution as:# pwd/home/admin/ansible/# vim web.yml—– name:hosts: devtasks:– name: create groupyum:name: httpdstate: latest– name: create groupgroup:name: apachestate: present– name: creating directioryfile:path: /webdevstate: directorymode: ‘2775’group: apache– sefcontext:target: ‘/webdev/index.html’setype: httpd_sys_content_tstate: present– name: Apply new SELinux file context to filesystemcommand: restorecon -irv– name: creating symbolic linkfile:src: /webdevdest: /var/www/html/webdevstate: linkforce: yes– name: creating filefile:path: /webdev/index.htmlsate: touch– name: Adding content to index.html filecopy:dest: /webdev/index.htmlcontent: “Development”– name: add service to the firewallfirewalld:service: httppermanent: yesstate: enabledimmediate: yes– name: active http serviceservice:name: httpdstate: restartedenabled: yes:wq# ansible-playbook web.yml –syntax-check# ansible-playbook web.ymlQ29. Create a playbook called balance.yml as follows:* The playbook contains a play that runs on hosts in balancers host group and usesthe balancer role.–> This role configures a service to loadbalance webserver requests between hostsin the webservers host group.curl–> When implemented, browsing to hosts in the balancers host group (for examplehttp://node5.example.com) should produce the following output:Welcome to node3.example.com on 192.168.10.z–> Reloading the browser should return output from the alternate web server:Welcome to node4.example.com on 192.168.10.a* The playbook contains a play that runs on hosts in webservers host group and usesthe phphello role.–> When implemented, browsing to hosts in the webservers host group with the URL /hello.php should produce the following output:Hello PHP World from FQDN–> where FQDN is the fully qualified domain name of the host. For example,browsing to http://node3.example.com/hello.php, should produce the following output:Hello PHP World from node3.example.com* Similarly, browsing to http://node4.example.com/hello.php, should produce thefollowing output:Hello PHP World from node4.example.com Solution as:# pwd/home/admin/ansible/# vim balancer.yml—– name: Including phphello rolehosts: webserversroles:– ./roles/phphello– name: Including balancer rolehosts: balancerroles:– ./roles/balancer:wq!# ansible-playbook balancer.yml –syntax-check# ansible-playbook balancer.ymlQ30. Create Logical volumes with lvm.yml in all nodes according to followingrequirements.—————————————————————————————-* Create a new Logical volume named as ‘data’* LV should be the member of ‘research’ Volume Group* LV size should be 1500M* It should be formatted with ext4 file-system.–> If Volume Group does not exist then it should print the message “VG Not found”–> If the VG can not accommodate 1500M size then it should print “LV Can not becreated withfollowing size”, then the LV should be created with 800M of size.–> Do not perform any mounting for this LV. Solution as:# pwd/home/admin/ansible# vim lvm.yml—– name:hosts: allignore_errors: yestasks:– name:lvol:lv: datavg: researchsize: “1500”– debug:msg: “VG Not found”when: ansible_lvm.vgs.research is not defined– debug:msg: “LV Can not be created with following size”when: ansible_lvm.vgs.research.size_g < “1.5”– name:lvol:lv: datavg: researchsize: “800”when: ansible_lvm.vgs.research.size_g < “1.5”– name:filesystem:fstype: ext4dev: /dev/research/data:wq!# ansible-playbook lvm.yml –syntax-check# ansible-playbook lvm.ymlQ31. 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 of test then write “Test” If host is a member of prod then write “Production”  Solution as:  Solution as: Q32. Create a playbook called hwreport.yml that produces an output file called /root/hwreport.txt on all managed nodes with the following information:——————————————————————————————————–> Inventory host name–> Total memory in MB–> BIOS version–> Size of disk device vda–> Size of disk device vdbEach line of the output file contains a single key-value pair.* Your playbook should:–> Download the file hwreport.empty from the URL http://classroom.example.com/hwreport.empty andsave it as /root/hwreport.txt–> Modify with the correct values.note: If a hardware item does not exist, the associated value should be set to NONE———————————————————————————————-while practising you to create these file hear. But in exam have to download as perquestation.hwreport.txt file consists.my_sys=hostnamemy_BIOS=biosversionmy_MEMORY=memorymy_vda=vdasizemy_vdb=vdbsize Solution as:# pwd/home/admin/ansible# vim hwreport.yml– name:hosts: allignore_errors: yestasks:– name: download fileget_url:url: http://classroom.example.com/content/ex407/hwreport.emptydest: /root/hwreport.txt– name: vdasizereplace:regexp: “vdasize”replace: “{{ ansible_facts.devices.vda.size }}”dest: /root/hwreport.txtregister: op1– debug:var: op1– name: nonereplace:regexp: “vdasize”replace: NONEdest: /root/hwreport.txtwhen:op1.failed == true– name: vdbsizereplace:regexp: “vdbsize”replace: “{{ ansible_facts.devices.vdb.size }}”dest: /root/hwreport.txtregister: op2– debug:var: op2– name: nonereplace:regexp: “vdbsize”replace: NONEdest: /root/hwreport.txtwhen:op2.failed == true– name: sysinforeplace:regexp: “{{item.src}}”replace: “{{item.dest}}”dest: /root/hwreport.txtloop:– src: “hostname”dest: “{{ ansible_facts.fqdn }}”– src: “biosversion”dest: “{{ ansible_facts.bios_version }}”– src: “memory”dest: “{{ ansible_facts.memtotal_mb }}”:wq!# ansible-playbook hwreport.yml –syntax-check# ansible-playbook hwreport.ymlQ33. Create a playbook that changes the default target on all nodes to multi-user tarqet. Do this in playbook file called target.yml in /home/sandy/ansible  – name: change default targethosts: alltasks:– name: change targetfile:src: /usr/lib/systemd/system/multi-user.target dest: /etc/systemd/system/default.target state: link  – name: change default targethosts: all– name: change targetfile:src: /usr/lib/systemd/system/multi-user.target dest: /etc/systemd/system/default.target state: link Q34. Create a playbook that changes the default target on all nodes to multi-user tarqet. Do this in playbook file called target.yml in /home/sandy/ansible – name: change default targethosts: alltasks:– name: change targetfile:src: /usr/lib/systemd/system/multi-user.target dest: /etc/systemd/system/default.target state: linkQ35. Rekey an existing Ansible vault as follows:———————————————–* Download Ansible vault from http:// classroom.example.com /secret.yml to /home/admin/ansible/* The current vault password is curabete* The new vault password is newvare* The vault remains in an encrypted state with the new password Solution as:# pwd/home/admin/ansible/# wget http://classroom.example.com/secret.yml# chmod 0600 newpassword.txt# ansible-vault rekey vault.yml –new-vault-password-file=newpassword.txtQ36. Create a playbook /home/bob /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”.  /home/sandy/ansible/apache.yml/home/sandy/ansible/roles/sample-apache/tasks/main.yml  /home/sandy/ansible/apache.yml/home/sandy/ansible/roles/sample-apache/tasks/main.yml  Loading … The RedHat EX294 certification exam is a highly respected certification for IT professionals who want to demonstrate their expertise in managing and deploying Linux systems. It requires hands-on experience and a deep understanding of the Linux operating system. With the increasing demand for Linux administrators in the industry, this certification can help IT professionals to enhance their career prospects and take their skills to the next level.   Verified EX294 dumps Q&As - Pass Guarantee Exam Dumps Test Engine: https://www.validbraindumps.com/EX294-exam-prep.html --------------------------------------------------- Images: https://free.validbraindumps.com/wp-content/plugins/watu/loading.gif https://free.validbraindumps.com/wp-content/plugins/watu/loading.gif --------------------------------------------------- --------------------------------------------------- Post date: 2023-04-30 10:13:51 Post date GMT: 2023-04-30 10:13:51 Post modified date: 2023-04-30 10:13:51 Post modified date GMT: 2023-04-30 10:13:51