[Mar 14, 2023] Reliable EX407 Exam Tips Test Pdf Exam Material
New 2023 EX407 Test Tutorial (Updated 42 Questions)
How to book the EX407 Exam
These are following steps for registering the Red Hat EX407 exam. Step 1: Choose your exam and a convenient way to train, then fill out the order form and submit payment. Step 2: Follow the steps in your purchase confirmation to log into the scheduler application and choose the time, date and location for your exam. Step 3: Show up for your exam on the chosen date and time, and take your exam.
NEW QUESTION 20
Which of the following are valid parameters of the template module? (Choose all that apply.)
- A. dest
- B. state
- C. validate
- D. .name
Answer: A,C
Explanation:
The validate parameter sets a program to check file syntax prior to deployment.
NEW QUESTION 21
Where does ansible-galaxy install place roles by default?
- A. $PWD/roles
- B. /etc/ansible/roles
- C. /etc/roles
- D. /usr/share/ansible/roles
Answer: B
Explanation:
This is the default location where ansible-galaxy install will attempt to install a role.
NEW QUESTION 22
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".
Answer:
Explanation:
/home/sandy/ansible/apache.yml
/home/sandy/ansible/roles/sample-apache/tasks/main.yml
NEW QUESTION 23
If forks is set to 100 and Ansible is run against an inventory of 50 servers, how many forks will Ansible create?
- A. 0
- B. 1
- C. 2
- D. 3
Answer: A
Explanation:
Ansible will only spin up the number of forks that is necessary as long as it is less than the maximum allowed. In this case, the max is 100 so Ansible will make 50 forks to match the number of hosts target.
NEW QUESTION 24
What special character is used to designate that you are passing a variable file to a play using the
-e flag?
- A. The pipe: "|"
- B. The plugs sign: "+"
- C. The at symbol: "@"
- D. There is no special character required.
Answer: C
Explanation:
The @ symbol will instruct Ansible to find the provided file and parse the file as a variable file.
NEW QUESTION 25
Install and configure ansible
Userbobhas been created on your control node. Give him the appropriate permissions on thecontrol 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 otherpath 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 bobuser.
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 group nodc4 and node 5 are members of groupprod.Also,prodis a member of group webservers.
Answer:
Explanation:
See the Explanation for complete Solution below.
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
NEW QUESTION 26
Which command will allow you to collect all facts for the specific host group 'labmachines'?
- A. ansible -c setup labmachines
- B. ansible-gather-facts labmachines
- C. ansible labmachines -m setup
- D. ansible labmachines -m facts
Answer: C
Explanation:
This command specifies the correct inventory and uses the setup module which gathers facts for target hosts.
NEW QUESTION 27
Which are of the following are valid uses of a role's meta directory? (Choose all that apply.)
- A. Setting variable values for use within a role.
- B. Setting the become flag.
- C. A role's dependency information.
- D. Setting the allow_duplicates flag.
Answer: C,D
Explanation:
This is a unique flag that is set in the meta directory to allow a role to be repeated within a play. Role dependencies may be defined within the meta directory of a role.
NEW QUESTION 28
Consider the following playbook:
# playbook name: /home/ansible/web.yml
---
- hosts: webservers
become: yes
tasks:
- name: edit file 1
lineinfile:
path: /var/www/content.hml line: "{{ text }}" tags:
- content
- name: edit file 2
lineinfile: path: /var/www/index.hml
line: "{{ text }}"
tags:
- web
- name: edit file 3
lineinfile:
path: /var/www/etc.hml
line: "{{ text }}"
tags: - content - misc
Which use of the ansible-playbook command on the provided playbook will result in ONLY editing the file /var/www/index.html?
- A. ansible-playbook /home/ansible/web.yml
- B. ansible-playbook /home/ansible/web.yml --skip-tags content
- C. ansible-playbook /home/ansible/web.yml --skip-tags web
- D. ansible-playbook /home/ansible/web.yml --tags content
Answer: B
Explanation:
This command skips the two tasks editing other files and only allows the task that is editing
/var/www/index.html to run.
NEW QUESTION 29
===================================================================================
control.realmX.example.com _ workstation.lab.example.com
node1.realmX.example.com _ servera.lab.example.com
node2.realmX.example.com _ serverb.lab.example.com
node3.realmX.example.com _ serverc.lab.example.com
node4.realmX.example.com _ serverd.lab.example.com
node5.realmX.example.com
- username:root, password:redhat
- username:admin, password:redhat
note1. don't change 'root' or 'admin' password.
note2. no need to create ssh-keygen for access, its pre-defined
note3. SELinux is in enforcing mode and firewalld is disabled/stop on whole managed hosts.
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.localdomain6
172.25.250.10 serevra.lab.example.com servera
172.25.250.11 serevrb.lab.example.com serverb
172.25.250.12 serevrc.lab.example.com serverc
172.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
::1
localhost localhost.localdomain localhost6 localhost6.localdomain6
-------------------------------------------------------------------
Answer:
Explanation:
Solution as:
# pwd
/home/admin/ansible
# wget http://classroom.example.com/hosts.j2
# vim hosts.j2
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1
localhost 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 information
hosts: all
tasks:
- name:
template:
src: hosts.j2
dest: /etc/myhosts
when: inventory_hostname in groups['dev']
:wq
# ansible-playbook gen_hosts.yml --syntax-check
# ansible-playbook gen_hosts.yml
NEW QUESTION 30
State whether the following statement is true or false.
The following is allowed in a playbook.
---
-
tasks:
yaml:
name=yum.
- hosts: local
- A. True
- B. False
Answer: B
Explanation:
Order is --- - hosts: local must be first.
NEW QUESTION 31
In /home/sandy/ansible/create a playbook called the play create a logical volume calledIv0and make it of size 1500MiB on volume group If there is not enough space in the volume groupprinta message
"Not enough space for logical volume" instead. If the volume group still doesn't exist, create a message"Volume group doesn't exist" filesystem on allIv0logical volumes. Don't mount the logical volume.
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
Solution as:
NEW QUESTION 32
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 from the servers.
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
1. ansible all -b -m yum -a 'name=php state=present'
2. ansible all -b -m yum -a 'name=php state=latest'
3. ansible all -b -m yum -a 'name=httpd state=latest'
4. ansible all -b -m yum -a 'name=httpd state=absent'
NEW QUESTION 33
Create 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.
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
/home/sandy/ansible/apache.yml
/home/sandy/ansible/roles/sample-apache/tasks/main.yml
/home/sandy/ansible/roles/sample-apache/templates/index.html.j2
In /home/sandy/ansible/roles/sample-apache/handlers/main.yml
NEW QUESTION 34
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.
Answer:
Explanation:
Solution as:

NEW QUESTION 35
Which flags must be accepted as input for a dynamic inventory script?
- A. --host [hostname] and --list
- B. Only --list
- C. --list and --format [file format]
- D. --host [hostname] and --inv-list
Answer: A
NEW QUESTION 36
===================================================================================
control.realmX.example.com _ workstation.lab.example.com
node1.realmX.example.com _ servera.lab.example.com
node2.realmX.example.com _ serverb.lab.example.com
node3.realmX.example.com _ serverc.lab.example.com
node4.realmX.example.com _ serverd.lab.example.com
node5.realmX.example.com
- username:root, password:redhat
- username:admin, password:redhat
note1. don't change 'root' or 'admin' password.
note2. no need to create ssh-keygen for access, its pre-defined
note3. SELinux is in enforcing mode and firewalld is disabled/stop on whole managed hosts.
Create a playbook called packages.yml that:
----------------------------------------------
--> Installs the php and mariadb packages on hosts in the dev, test, and prod host
groups.
--> Installs the Development Tools package group on hosts in the dev host group.
--> Updates all packages to the latest version on hosts in the dev host group.
Answer:
Explanation:
Solution as:
# pwd
home/admin/ansible/
# vim packages.yml
---
- name: Install the packages
hosts: dev,test,prod
vars:
- php_pkg: php
- mariadb_pkg: mariadb
tasks:
- name: install the packages
yum:
name:
- "{{ php_pkg }}"
- "{{ mariadb_pkg }}"
state: latest
- name: install the devops tool packages
hosts: dev
tasks:
- name: install devepment tools
yum:
name: "@Development Tools"
state: latest
- name: upgrade all the packages
yum:
name: "*"
state: latest
exclude: kernel*
!wq
# ansible-playbook package.yml --syntax-check
# ansible-playbook package.yml
NEW QUESTION 37
Install and configure ansible
User 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.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 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.
Answer:
Explanation:
See the Explanation for complete Solution below.
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
NEW QUESTION 38
Where are custom facts defined on a host?
- A. /etc/ansible/facts.d/<HOSTNAME>
- B. /etc/ansible/facts.d/*.fact
- C. /etc/ansible/<HOST>/*.fact
- D. /etc/ansible/facts.db
Answer: B
Explanation:
Custom facts are gathered from all files with the .fact extension in /etc/ansible/facts.d.
NEW QUESTION 39
Where is Ansible's inventory stored by default?
- A. .etc/ansible/hosts
- B. etc/ansible/inventory
- C. ${HOME}/inventory for the currently logged in user
- D. /home/ansible/inventory
Answer: A
NEW QUESTION 40
Create a file called requirements.yml in /home/sandy/ansible/roles a file called role.yml in
/home/sandy/ansible/. The haproxy-role should be used on the proxy host. And when you curl
http://node3.example.com it should display "Welcome to node4.example.com" and when you curl again
"Welcome to node5.example.com" The php-role should be used on the prod host.
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
Solution as:
Check the proxy host by curl http://node3.example.com
NEW QUESTION 41
......
Difficulty in writing EX407 Exam
Candidates face many problems when they start preparing for the Red Hat EX407 exam. If a candidate wants to prepare his for the Red Hat EX407 exam without any problem and get good grades in the exam. Then they have to choose the best Red Hat EX407 exam dumps for real exam questions practice. There are many websites that are offering the latest Red Hat EX407 exam questions and answers but these questions are not verified by Red Hat certified experts and that's why many are failed in their just first attempt. TestValid is the best platform which provides the candidate with the necessary Red Hat EX407 questions that will help him to pass the Red Hat EX407 exam on the first time. The candidate will not have to take the Red Hat EX407 exam twice because with the help of Red Hat EX407 exam dumps Candidate will have every valuable material required to pass the Red Hat EX407 exam. We are providing the latest and actual questions and that is the reason why this is the one that he needs to use and there are no chances to fail when a candidate will have valid Red Hat EX407 exam dumps from TestValid. We have the guarantee that the questions that we have will be the ones that will pass candidate in the Red Hat EX407 exam in the very first attempt.
EX407 Cert Guide PDF 100% Cover Real Exam Questions: https://passtorrent.testvalid.com/EX407-valid-exam-test.html