[Q19-Q40] Tested Material Used To EX407 Test Engine Exam Questions in here [Oct-2021]

Share

Tested Material Used To EX407 Test Engine Exam Questions in here [Oct-2021]

Penetration testers simulate EX407 exam PDF

NEW QUESTION 19
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 20
Consider the provided dictionary variable definition:
drives:
name: hd1
type: physical
size: 1G
Which of the following are valid ways to retrieve data from this dictionary? (Choose all that apply.)

  • A. {{ drives-name }}
  • B. {{ drives }}
  • C. {{ drives.size }}
  • D. {{ drives['type'] }}

Answer: B,C,D

Explanation:
{{ drives }}: This will return the whole dictionary.
{{ drives.size }}: This will return the size value for the drives dictionary.

 

NEW QUESTION 21
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 22
Create a role called sample-apache and store it in /home/bob/ansible/roles. The role should satisfy the following requirements:
*In the role, install and enable httpd. Also enable the firewall to allow http. Also run the template
*index.html.j2 and make sure this runs Create a template index.html.j2 that displays "Welcome to the server HOSTNAME" In a play called apache.yml in /home/bob/ansible/ run the sample-apache role.

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 23
Consider the following play excerpt:
- name: deploy app config
template:
src: app.xml.j2
dest: /etc/app.xml
notify:
- restart memcached
- restart apache
- name: deploy httpd config
template:
src: httpd.conf.j2
dest: /etc/httpd/conf/httpd.conf
notify:
- restart apache
- name: deploy httpd config
template:
src: site.conf.j2
dest: /etc/httpd/conf/site.conf
notify:
- restart apache
Presuming all of the listed tasks in the play change the files they act on and the handler is correctly defined in another file, how many times is the "restart apache" handler ran?

  • A. 0
  • B. 1
  • C. 2
  • D. 3

Answer: B

Explanation:
As long as at least one change is made that calls the restart apache handler, it will be run once.

 

NEW QUESTION 24
Create an empty encrypted file calledmyvault.yml in /home/sandy/ansibleand set the passwordtonotsafepw.
Rekey the passwordtoiwejfj2221.

Answer:

Explanation:
See the Explanation for complete Solution below.
Explanation
ansible-vault create myvault.yml
Create new password: notsafepw Confirm password: notsafepwansible-vault rekeymyvault.yml Current password: notsafepw New password: iwejfj2221 Confirm password: iwejfj2221

 

NEW QUESTION 25
Which of the following is a good use case for an ad-hoc command? (Choose all that apply.)

  • A. Upgrading a custom 3-tier application stack
  • B. Checking the free memory on a particular group of hosts
  • C. Installing the netcat utility on application servers
  • D. Experimenting with an Ansible Module

Answer: B,C,D

Explanation:
Installing netcat is a single yum command that would be easily run across a group of common servers with an Ansible ad-hoc command. A single command run against several servers is a perfect use case for an ad-hoc command. Writing a playbook would be overkill.

 

NEW QUESTION 26
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 27
What keyword sets a change condition for a given task?

  • A. register_change
  • B. changed_when
  • C. flag_change
  • D. change_set

Answer: A

 

NEW QUESTION 28
Create a playbook that changes the default target on all nodes to multi-user tarqet. Do this in playbook file called target.yml in /home/sandy/ansible

Answer:

Explanation:
See the Explanation for complete Solution below.
Explanation
- name: change default target
hosts: all
tasks:
- name: change target
file:
src: /usr/lib/systemd/system/multi-user.target dest: /etc/systemd/system/default.target state: link

 

NEW QUESTION 29
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 oftestthen write "Test" If host is a member ofprodthen write "Production"

Answer:

Explanation:
See the Explanation for complete Solution below.
Explanation
Solution as:

 

NEW QUESTION 30
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 31
Create a file called packages.yml in /home/sandy/ansible to install some packages 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 for complete 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 development node
yum:
name: '*'
state: latest

 

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
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 34
Templates must be written in what language?

  • A. Jinja2
  • B. XML
  • C. Ruby
  • D. INI

Answer: A

Explanation:
Templates are parsed using the Jinja2 templating language.

 

NEW QUESTION 35
Where is Ansible's inventory stored by default?

  • A. etc/ansible/inventory
  • B. ${HOME}/inventory for the currently logged in user
  • C. .etc/ansible/hosts
  • D. /home/ansible/inventory

Answer: C

Explanation:
Explanation/Reference:

 

NEW QUESTION 36
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 37
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 38
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 39
Install and configure ansible
User sandy has been created on your control node with the appropriate permissions already, do not change or modify ssh keys. Install the necessary packages to run ansible on the control node. Configure ansible.cfg to be in folder /home/sandy/ansible/ansible.cfg and configure to access remote machines via the sandy user. All roles should be in the path /home/sandy/ansible/roles. The inventory path should be in
/home/sandy/ansible/invenlory.
You will have access to 5 nodes.
node1.example.com
node2.example.com
node3.example.com
node4.example.com
node5.example.com
Configure these nodes to be in an inventory file where node I is a member of group dev. nodc2 is a member of group test, node3 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]
node1 .example.com
[test]
node2.example.com
[proxy]
node3 .example.com
[prod]
node4.example.com
node5 .example.com
[webservers:children]
prod

 

NEW QUESTION 40
......

Authentic Best resources for EX407 Online Practice Exam: https://www.testsdumps.com/EX407_real-exam-dumps.html

Get the superior quality EX407 Dumps with explanations waiting just for you, get it now: https://drive.google.com/open?id=1MRDNxjxBsP14CMM2NTYXBuOKSv-2bxBl