Best Quality RedHat EX407 Exam Questions RealExamFree Realistic Practice Exams [2021]
Critical Information To Red Hat Certified Specialist in Ansible Automation exam Pass the First Time
NEW QUESTION 68
An Ansible inventory may contain which of the following? (Choose all that apply.)
- A. Groups
- B. Hosts
- C. Variable declarations
- D. Plays
Answer: A,B,C
Explanation:
Groups of hosts (and even groups of groups) may be defined within an inventory. The primary purpose of an Ansible inventory is to maintain a list of hosts with which Ansible may interact.
NEW QUESTION 69
How is a role name set?
- A. Ansible loads a role name from the roles meta/main.yml file.
- B. All role names are defined in the file /etc/ansible/roles.
- C. Ansible loads a role name using the role keyword in the roles tasks/main.yml file.
- D. The role name is defined by the directory containing the role.
Answer: D
NEW QUESTION 70
Create anansible vault password file called reallysafepwin the/home/sandy/ansible directory. In the lock.yml file define two variables. One is and the password is 'dev' and the other is pw_mgrand the password is 'mgr' Create a regular file called which contains the password for lock.yml.
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
ansible-vault create lock.yml
New Vault Password: reallysafepw
Confirm: reallysafepw
NEW QUESTION 71
Observe the details of the following dynamic inventory file.
$ ls -l dynamic.py -rw-rw-r--. 1 user user 1928 Mar 30 08:21 dynamic.py Why will this inventory file cause the ansible command to fail?
- A. The file is not executable.
- B. The ansible user must own the file.
- C. Ansible cannot use python scripts as inventories.
- D. The ansible command will not fail using the noted file with the given details.
Answer: A
Explanation:
Without being executable. Ansible will attempt to parse the script as a static inventory and fail.
NEW QUESTION 72
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 73
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 a disk does not exist then write NONE.
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
Solution as:

NEW QUESTION 74
Which of the following are Ansible modules? (Choose all that apply.)
- A. setup
- B. get_dnshostname
- C. ping
- D. yum
Answer: A,C,D
Explanation:
yum: this module was covered in the lesson and can be found in Ansible documentation.
NEW QUESTION 75
State whether the following statement is true or false.
You can change the no of forks ansible uses from the /etc/ansible/ansible.cfg file.
- A. True
- B. False
Answer: A
Explanation:
/etc/ansible/ansible.cfg file is the default location of the configuration file.
NEW QUESTION 76
Which flags must be accepted as input for a dynamic inventory script?
- A. --host [hostname] and --list
- B. Only --list
- C. --host [hostname] and --inv-list
- D. --list and --format [file format]
Answer: A
NEW QUESTION 77
Where are custom facts defined on a host?
- A. /etc/ansible/facts.db
- B. /etc/ansible/facts.d/*.fact
- C. /etc/ansible/<HOST>/*.fact
- D. /etc/ansible/facts.d/<HOSTNAME>
Answer: B
Explanation:
Custom facts are gathered from all files with the .fact extension in /etc/ansible/facts.d.
NEW QUESTION 78
State whether the following statement is true or false.
Ansible expects templates to use json format.
- A. False
- B. True
Answer: A
Explanation:
They don't use json format.
NEW QUESTION 79
What is the primary difference between the shell and command module?
- A. The shell module sets up a shell environment and the command module only runs the provided command.
- B. The shell module is for executing shell commands, and the command module is for Ansible internal commands.
- C. There is no difference.
- D. The shell module sets a default shell whereas the command module executes a shell command.
Answer: A
NEW QUESTION 80
Which command is the correct way to run the playbook /home/ansible/Buildwww.yml using the inventory file
/home/ansible/inventory, assuming your present working directory is /home/ansible?
- A. ansible -i inventory Build.yml
- B. ansible-playbook -i inventory Buildwww.yml
- C. ansible -i inventory -p Buildwww.yml
- D. ansible-playbook -i inventory -p Buildwww.yml
Answer: B
Explanation:
This command is the correct way to run the playbook using the requested inventory
NEW QUESTION 81
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 after you pass this task.
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
chmod 0777 adhoc.sh
vim adhoc.sh
#I/bin/bash
ansible all -m yum_repository -a 'name=EPEL description=RHEL8
baseurl=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rmp gpgcheck=no enabled=yes'
NEW QUESTION 82
Which are of the following are valid uses of a role's meta directory? (Choose all that apply.)
- A. A role's dependency information.
- B. Setting variable values for use within a role.
- C. Setting the allow_duplicates flag.
- D. Setting the become flag.
Answer: A,C
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 83
A dynamic inventory must return data in what format?
- A. YAML
- B. JSON
- C. XML
- D. INI
Answer: B
Explanation:
Dynamic inventories must return JSON output.
NEW QUESTION 84
Which Ansible ad-hoc flag is analogous to the become directive?
- A. B
- B. i
- C. b
- D. f
Answer: C
Explanation:
The b flag actually stands for become! They both have Ansible escalate to the become_user.
NEW QUESTION 85
What are the minimum configurations that must be made to install Ansible Tower?
- A. You must provide a target host and set some key user passwords.
- B. You must specify a few key user passwords.
- C. PROJECTS_ROOT must be configured.
- D. You must generate an SSL certificate for the Ansible Tower web frontend.
Answer: C
Explanation:
This is the only required configuration change needed prior to installation.
NEW QUESTION 86
Where does ansible-galaxy install place roles by default?
- A. /usr/share/ansible/roles
- B. $PWD/roles
- C. /etc/ansible/roles
- D. /etc/roles
Answer: C
Explanation:
This is the default location where ansible-galaxy install will attempt to install a role.
NEW QUESTION 87
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 --tags content
- 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
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 88
What command is used to run a playbook?
- A. ansible-playbook <playbook>
- B. playbook <playbook>
- C. ansible <playbook>
- D. ansible-p <playbook>
Answer: A
Explanation:
This command will run a given playbook successfully.
NEW QUESTION 89
Create 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/ansiblecalledhosts.yml and install the template on dev node at/root/myhosts
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
Solution as:
NEW QUESTION 90
Create a playbook /home/bob/ansible/timesync.yml that runs on hosts in the webservers host group and does the following:
* Uses the timesync RHEL system role.
* Sets the ntp server to 0.uk.pool.ntp.org
* Sets the timezone to UTC
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
Solution as:
NEW QUESTION 91
Create a file calledadhoc.shin/home/sandy/ansiblewhich will use adhoc commands to set up a new repository. The name of the repo will be 'EPEL' thedescription '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.
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
chmod0777adhoc.sh
vim adhoc.sh
#I/bin/bash
ansible all -m yum_repository -a 'name=EPEL description=RHEL8
baseurl=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rmp gpgcheck=no enabled=yes'
NEW QUESTION 92
......
EX407 EXAM DUMPS WITH GUARANTEED SUCCESS: https://www.realexamfree.com/EX407-real-exam-dumps.html
Best Quality RedHat EX407 Exam Questions: https://drive.google.com/open?id=1-TwlHUFcSw_xNBl8CbxsvX9EY8HBNgrd

