Latest [Oct 13, 2021] EX407 Exam with Accurate Red Hat Certified Specialist in Ansible Automation exam PDF Questions
Take a Leap Forward in Your Career by Earning RedHat 126 Questions
NEW QUESTION 52
CORRECT TEXT
Using the Simulation Program, perform the following tasks:
1. Use an ansible ad-hoc command, check the connectivity of your servers.
2. Use an ad-hoc ansible command, find the free space of your servers.
3. Use an ad-hoc ansible command, find out the memory usage of your servers.
4. Do an ls -l on the targets /var/log/messages file.
5. Tail the contents of the targets /var/log/messages file.
Answer:
Explanation:
See explanation below.
Explanation:
1. ansible all -m ping
2. ansible all -a "/bin/df -h"
3. ansible all -a "/usr/bin/free"
4. ansible all -a "ls -l /var/log/messages"
5. ansible local -b -a "tail /var/log/messages"
NEW QUESTION 53
What special character is used to designate that you are passing a variable file to a play using the -e flag?
- A. The at symbol: "@"
- B. The plugs sign: "+"
- C. There is no special character required.
- D. The pipe: "|"
Answer: A
Explanation:
The @ symbol will instruct Ansible to find the provided file and parse the file as a variable file.
NEW QUESTION 54
Which of the following are shared between roles on the same system? (Choose all that apply.)
- A. Tasks
- B. Handlers
- C. Templates
- D. Variables
Answer: B,D
Explanation:
Variables are shared across roles on the same system. This is why namespacing is important. Handlers are shared across roles on the same system.
NEW QUESTION 55
What does the lineinfile module do?
- A. Allow additions of lines to the end of a file only
- B. Input data into a file from stdin
- C. Allow addition of lines anywhere in a file
- D. Allows to grep for lines in a provided file
Answer: C
Explanation:
The purpose of the lineinfile module is to add lines anywhere in a file passed on a pattern.
NEW QUESTION 56
Which command will use servers in a local inventory called invent.local?
- A. ansible all -m ping -f invent.local
- B. ansible servers -m ping
- C. ansible all -m ping -i invent.local
- D. ansible all -m ping
Answer: C
NEW QUESTION 57
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 58
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:
See the Explanation for complete Solution below.
Explanation
/home/sandy/ansible/apache.yml
/home/sandy/ansible/roles/sample-apache/tasks/main.yml
NEW QUESTION 59
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 60
State whether the following statement is true or false.
There is a 10 user trial available.
- A. True
- B. False
Answer: A
NEW QUESTION 61
Create an empty encrypted file called and set the password to
notsafepw. Rekey the password to
Answer:
Explanation:
See the Explanation for complete Solution below.
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
NEW QUESTION 62
Where can you find documentation on Ansible modules? (Choose all that apply.)
- A. Ansible online documentation.
- B. Using the ansible-doc command.
- C. The Ansible man page.
- D. The Ansible-Module man page.
Answer: A,B
Explanation:
The ansible-doc command is designed to provide module documentation. Module documentation may be found online.
NEW QUESTION 63
State whether the following statement is true or false.
The correct structure for use with roles has the various portions of the role under a central folder.
E.g. if the role is called apache then the location of the tasks would be the following:
apache - tasks - main.yml
- A. True
- B. False
Answer: A
Explanation:
This is the format for the file system used for roles:
project/
defaults
main.yml
files
handlers
main.yml
meta
main.yml
README.md
tasks
main.yml
templates
tests
inventory
test.yml
vars
main.yml
NEW QUESTION 64
Create a file called mysecret.yml on the control host using ansible vault in home/bob/ansible. Set the password to 'notasafepass' and inside the file create a variable called dev_pass with the value of devops. Save the file.
Then go back in the file and change dev_pass value to devops123. Then change the vault password of mysecret.yml to verysafepass
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
ansible-vault create lock.yml
New Vault Password: reallysafepw
Confirm: reallysafepw
NEW QUESTION 65
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 66
What does the when keyword do?
- A. Allows a play to be scheduled
- B. Allows a task to be conditional
- C. There is no when keyword
- D. Allows a play to be conditional
Answer: B
NEW QUESTION 67
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 68
......
Authentic Best resources for EX407 Online Practice Exam: https://www.torrentvce.com/EX407-valid-vce-collection.html
Practice To EX407 - TorrentVCE Remarkable Practice On your Red Hat Certified Specialist in Ansible Automation exam Exam: https://drive.google.com/open?id=1jSxbQ_pYN_Ru3vS93vSQMw48CslSoowG