RHCE/EX294 Version 9 Exam Practice Questions

What Should I know About The RHCE/ex294 Exam

If you need some other practice questions that are not listed here, feel free to send an email to info@tekneed.com, and we will let you know if we have them or not.

RHCE/EX294.v9 exam practice questions 1


On drdev1.tekneed.com, install and configure Ansible as follows:


*Install the necessary packages.


*Create a static inventory file called /home/lisa/ansible/inventory as follows:
– host1.tekneed.com is a member of the development host group
– host2.tekneed.com is a member of the quality_assurance host group
– host3.tekneed.com and host4.tekneed.com are members of the production host group
– host5.tekneed.com is a member of the security host group
– The security group is a member of the hpc_servers host group


*Create a configuration file called ansible.cfg as follows:

– /home/lisa/ansible/inventory/ must be defined as the host inventory file.
– /home/lisa/ansible/roles/ must be the location of the roles in the playbooks

-The escalation user, and the user that will be used to manage the remote hosts must be root.


This question is based on installing, configuring, and creating Ansible static inventory in the RHCE/EX294 course on this website. If you have gone through this course, solving this wouldn’t be a problem.

RHCE/EX294 Course

Installing Ansible In Linux

Creating and Managing Ansible Configuration File

Setup/Build Ansible Static Inventory

Answer

1. Install Ansible

[lisa@drdev1 ~]$ sudo dnf install ansible-core ansible-navigator tree -y

Updating Subscription Management repositories.
.........
 ansible-core             x86_64     2.13.3-2.el9_1       rhel-9-for-x86_64-appstream-rpms     2.7 M
Installing dependencies:
....................

2. Create the static inventory with the name, /home/lisa/ansible/inventory

[lisa@drdev1 ~]$ mkdir -p /home/lisa/ansible/
[lisa@drdev1 ~]$ vim /home/lisa/ansible/inventory
[development]
host1.tekneed.com

[quality_assurance]
host2.tekneed.com

[production]
host3.tekneed.com
host4.tekneed.com

[security]
host5.tekneed.com

[hpc_servers:children]
security
RHCE 8  ex294 exam practice question 1

3. create the ansible.cfg configuration file, and add the inventory and roles path.

NOTE: you can always use the Ansible global configuration file (/etc/ansible/ansible.cfg) as a reference in case you forget any key-value pair to use in the configuration file.

[lisa@drdev1 ~]$ vim /home/lisa/ansible/ansible.cfg
[defaults]
inventory=/home/lisa/ansible/inventory
roles_path=/home/lisa/ansible/roles:/etc/ansible/roles:/usr/share/ansible/roles
ask_pass=false
remote_user=root

[privilege_escalation]
become=true
become_method=sudo
become_user=root
become_ask_pass=false

NB: The roles path that will be added will be the ones defined in your questions.

4. Verify the inventory configuration

[controller@drdev1 ~]$ cd /home/lisa/ansible/
[lisa@drdev1 ansible]$ ansible --list-hosts all
  hosts (5):
    host1.tekneed.com
    host2.tekneed.com
    host3.tekneed.com
    host4.tekneed.com
    host5.tekneed.com

5. Verify the current Ansible configuration file.

[lisa@drdev1 ansible]$ ansible --version

ansible [core 2.13.3]
  config file = /home/lisa/ansible/ansible.cfg
  configured module search path = ['/home/lisa/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/lisa/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.10 (main, Feb  9 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)]
  jinja version = 3.1.2
  libyaml = True
rhce/ex294.v9 exam practice questions

6. If you wish, you can also test by pinging all the managed hosts

[lisa@drdev1 ansible]$ ansible all -m ping

Solution Summary

#dnf install ansible
#vim /home/lisa/ansible/inventory
#vim /home/lisa/ansible/.ansible.cfg
#ansible all -m ping

click on the link below to watch video on RHCE/EX294.v9 exam practice question 1

Watch Video On RHCE/EX294.v9 Exam Practice Questions 1

Your feedback is welcomed. If you love others, you will share with others

RHCE/EX294.v9 exam practice question 2


Get The Premium RHCE/EX294.V9 Exam Practice Questions

8 Comments

Leave a Reply

Your email address will not be published.


*