[Sep-2021] Pass RedHat EX407 Exam in First Attempt Guaranteed!
Full EX407 Practice Test and 126 unique questions with explanations waiting just for you, get it now!
NEW QUESTION 31
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 32
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 33
Where can you find a list of all modules in the Ansible online documentation?
- A. Module Index
- B. Master Module List
- C. There is not a full list of all modules in the online documentation.
- D. All modules are listed on the online documentation landing page.
Answer: A
Explanation:
The module index is how the online documentation references the full list of modules.
NEW QUESTION 34
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: C
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 35
Why is it important to create a namespace for role variables?
- A. Roles only have access to variables in their own namespace.
- B. Namespacing role variables helps avoid conflicts with variables defined outside of the role.
- C. It is not really important.
- D. Ansible requires namespaces to be set for a role and will error without them.
Answer: B
Explanation:
Because roles share variables and because plays can have variables defined outside of the role, namespacing role variables ensures that you are getting the variable you expect to get.
NEW QUESTION 36
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 37
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 38
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 39
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 40
State whether the following statement is true or false.
There is a 10 user trial available.
- A. True
- B. False
Answer: A
NEW QUESTION 41
Create a playbook called issue.yml in /home/sandy/ansible which changes the file /etc/issue on all managed nodes: If host is a member of (lev then write "Development" If host is a member of test then write "Test" If host is a member of prod then write "Production"
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
Solution as:
NEW QUESTION 42
What type of credential is used for accessing system accounts on your remote Linux hosts via SSH in Ansible Tower?
- A. Machine
- B. Ansible Tower
- C. System
- D. Insights
Answer: A
Explanation:
This is the appropriate credential for working with remote hosts over SSH.
NEW QUESTION 43
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 44
What is wrong with the following command:
ansible all -a "mkdir/tmp/testfile"
- A. The command will execute without error.
- B. The -b flag is required.
- C. There is not a module specified.
- D. There is not an inventory file specified.
Answer: A
Explanation:
This command will execute using the command module by default.
NEW QUESTION 45
What does the -p flag do with the ansible-galaxy command?
- A. Allows ansible-galaxy to pull a role down to the local server.
- B. Allows the user to provide a role path other than the default to be used when installing a role.
- C. Instructs ansible-galaxy to install the role permanently to persist a reboot.
- D. Allows ansible-galaxy to push a role to a target.
Answer: B
NEW QUESTION 46
How does a user Access Ansible Tower once it is installed?
- A. By running 'tower-connect' from your local CLI (on a graphical environment) and specifying the hostname of your Ansible Tower server.
- B. By connecting making an https request to the server tower is installed on using a browser.
- C. By running the ansible command and supplying the --tower flag running.
- D. By connecting to the control host using ssh and running 'tower-tui'
Answer: B
Explanation:
Ansible Tower runs a web app and should be accessed using a browser over https.
NEW QUESTION 47
Create a file called packages.yml in/home/sandy/ansibleto install somepackages for the following hosts. On dev, prod and webservers install packages httpd, mod_ssl, and mariadb. On dev only install the development tools package. Also, on dev host update all the packages to the latest.
Answer:
Explanation:
See the Explanation forcomplete Solution below.
Explanation
Solution as:
** NOTE 1 a more acceptable answer is likely 'present' since it's not asking to install the latest state: present
** NOTE 2 need to update the development node
- name: update all packages on developmentnode
yum:
name: '*'
state: latest
NEW QUESTION 48
Where is the first place Ansible checks for a role definition?
- A. Ansible must always be told where to look for a role.
- B. /etc/ansible/roles
- C. ${PWD}/.roles
- D. ${PWD}/roles
Answer: D
Explanation:
Ansible always checks the present working directory for a roles directory containing a referenced role definition.
NEW QUESTION 49
State whether the following statement is true or false.
A template can only use 1 variable.
- A. False
- B. True
Answer: A
Explanation:
You can use multiple variables in templates.
NEW QUESTION 50
Create the users in the fileusersjist.ymlfile provided. Do this in a playbook called users.yml located at
/home/sandy/ansible.The passwords for these users should be set using thelock.ymlfile from TASK7. When running the playbook, the lock.yml file should be unlocked withsecret.txtfile from TASK 7.
All users with the job of 'developer' should be created on thedevhosts, add them to the group devops, their password should be set using thepw_devvariable. Likewise create users with the job of 'manager' on theproxy host and add the users to the group 'managers', their password should be set using thepw_mgrvariable.
Answer:
Explanation:
See the Explanation for complete Solution below.
Explanation
ansible-playbook users.yml -vault-password-file=secret.txt
NEW QUESTION 51
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 52
......
Get Latest EX407 Dumps Exam Questions in here: https://www.itexamsimulator.com/EX407-brain-dumps.html

