Limited-Time Offer: Enjoy 50% Savings! Ends in 00h 00m 00s Coupon code: 50OFF
Skip to content

Free RedHat Red Hat Certified Engineer (RHCE) exam for Red Hat Enterprise Linux 8 Exam EX294 Exam Questions

Page: 1 / 6 Total 35 questions

Want more questions? Get Premium Access.

Question 1

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.

Correct Answer: A. Explanation: Solution as:

Question 2

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.

Correct Answer: 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

Question 3

Install the RHEL system roles package and create a playbook called timesync.yml that:

--> Runs over all managed hosts.

--> Uses the timesync role.

--> Configures the role to use the time server 192.168.10.254 ( Hear in redhat lab

use "classroom.example.com" )

--> Configures the role to set the iburst parameter as enabled.

Correct Answer: A. Explanation: Solution as: # pwd home/admin/ansible/ # sudo yum install rhel-system-roles.noarch -y # cd roles/ # ansible-galaxy list # cp -r /usr/share/ansible/roles/rhelsystem-roles.timesync . # vim timesync.yml --- - name: timesynchronization hosts: all vars: timesync_ntp_provider: chrony timesync_ntp_servers: - hostname: classroom.example.com _ in exam its ip-address iburst: yes timezone: Asia/Kolkata roles: - rhel-system-roles.timesync tasks: - name: set timezone timezone: name: '{{ timezone }}' :wq! timedatectl list-timezones | grep india # ansible-playbook timesync.yml --syntax-check # ansible-playbook timesync.yml # ansible all -m shell -a 'chronyc sources -v' # ansible all -m shell -a 'timedatectl' # ansible all -m shell -a 'systemctl is-enabled chronyd'

Question 4

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'

Correct Answer: A. Explanation: Solution as:

Question 5

Create an empty encrypted file called myvault.yml in /home/sandy/ansible and set the password to notsafepw. Rekey the password to iwejfj2221.

Correct Answer: A. Explanation: ansible-vault create myvault.yml Create new password: notsafepw Confirm password: notsafepw ansible-vault rekey myvault.yml Current password: notsafepw New password: iwejfj2221 Confirm password: iwejfj2221

Question 6

Create user accounts

------------------------

--> A list of users to be created can be found in the file called user_list.yml

which you should download from http://classroom.example.com/user_list.yml and

save to /home/admin/ansible/

--> Using the password vault created elsewhere in this exam, create a playbook called

create_user.yml

that 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 the

password 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 from

the "mgr_pass" variable

and these user should be member of supplementary group "opsmgr"

--> Passwords should use the "SHA512" hash format. Your playbook should work using

the vault password file

created elsewhere in this exam.

while practising you to create these file hear. But in exam have to download as per

questation.

user_list.yml file consist:

---

user:

- name: user1

job: developer

- name: user2

job: manager

Correct Answer: A. Explanation: Solution as: # pwd /home/admin/ansible # wget http://classroom.example.com/user_list.yml # cat user_list.yml # vim create_user.yml --- - name: hosts: all vars_files: - ./user_list.yml - ./vault.yml tasks: - name: creating groups group: name: '{{ item }}' state: present loop: - devops - opsmgr - name: creating user user: name: '{{ item.name }}' state: present groups: devops password: '{{ dev_pass|password_hash ('sha512') }}' loop: '{{ user }}' when: (inventory_hostname in groups['dev'] or inventory_hostname in groups['test']) and item.job == 'developer' - name: creating user user: name: '{{ item.name }}' state: present groups: opsmgr password: '{{ 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.txt