100% Pass Your EX407 Exam Dumps at First Attempt with Real4dumps [Q39-Q63]

Share

100% Pass Your EX407 Exam Dumps at First Attempt with Real4dumps

Penetration testers simulate EX407 exam PDF

NEW QUESTION 39
Create a role called sample-apache in/home/sandy/ansible/rolesthat enables and starts httpd, enables and starts the firewall and allows the webserver service. Create a templatecalledindex.html.j2which creates and serves a message from/var/www/html/index.htmlWhenever 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 theip address of the node using ansible facts. Lastly, create a playbook in 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 40
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 41
Create a playbook called webdev.yml . The playbook will create a directory Avcbdev on dev host. The permission of the directory are 2755 and owner is webdev. Create a symbolic link from
/Webdev to /var/www/html/webdev. Serve a file from Avebdev7index.html which displays the text
"Development" Curl http://node1.example.com/webdev/index.html to test

Answer:

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

 

NEW QUESTION 42
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 43
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 44
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 45
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/ansible called hosts.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 46
Which of the following are valid default locations for Ansible configuration? (Choose all that apply.)

  • A. ${HOME}/.ansible.cfg
  • B. etc/ansible/ansible.cfg
  • C. /etc/ansible/config
  • D. ${ANSIBLE_CONFIG}

Answer: A,B,D

Explanation:
etc/ansible/ansible.cfg:This is where Ansible configuration is stored by default.
${HOME}/.ansible.cfg: Ansible will check this file for configuration.

 

NEW QUESTION 47
Which of the following attributes specifies how a handler can be notified? (Choose all that apply.)

  • A. name
  • B. handle
  • C. listen
  • D. service

Answer: A,C

Explanation:
While using the handler's name attribute is not encouraged, it does work.

 

NEW QUESTION 48
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 49
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 50
In /home/sandy/ansible/ create a playbook called logvol.yml. In the play create a logical volume called Iv0 and make it of size 1500MiB on volume group vgO If there is not enough space in the volume group print a message "Not enough space for logical volume" and then make a 800MiB Iv0 instead. If the volume group still doesn't exist, create a message "Volume group doesn't exist" Create an xfs filesystem on all Iv0 logical volumes. Don't mount the logical volume.

Answer:

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

 

NEW QUESTION 51
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 52
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 53
What formats may variables specified on the command line use when not using a file with the -e flag? (Choose all that apply.)

  • A. YAML
  • B. JSON
  • C. CSV
  • D. Ansible dictionary

Answer: A,B

Explanation:
Variables must be specified in JSON format when passed via command line.

 

NEW QUESTION 54
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 55
Create a file calledrequirements.ymlin/home/sandy/ansible/rolesa file calledrole.yml in
/home/sandy/ansible/.Thehaproxy-roleshould be used on theproxyhost. And when you curl
http://node3.example.comit should display "Welcome tonode4.example.com" and when you curl again
"Welcome tonode5.example.com"Thephp-roleshould be used on theprodhost.

Answer:

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

Check the proxy host by curlhttp://node3.example.com

 

NEW QUESTION 56
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 57
Which is the default inventory file used by Ansible?

  • A. /etc/hosts
  • B. /etc/ansible/hosts
  • C. ${PWD}/.inventory
  • D. /etc/ansible/inventory

Answer: B

Explanation:
Ansbile refers to /etc/ansible/hosts as the default inventory.

 

NEW QUESTION 58
Create a file calledrequirements.ymlin/home/sandy/ansible/rolesto install two roles. The source for the first role is geerlingguy.haproxy and geerlingguy.php. Name the first haproxy-role and the second php-role. The roles should be installed in/home/sandy/ansible/roles.

Answer:

Explanation:
See the Explanation for complete Solution below.
Explanation
in /home/sandy/ansible/roles
vim requirements.yml

Run the requirements file from the roles directory:
ansible-galaxy install -r requirements.yml -p/home/sandy/ansible/roles

 

NEW QUESTION 59
Create an ansible vault password file called lock.yml with the password reallysafepw in the
/home/sandy/ansible directory. In the lock.yml file define two variables. One is pw_dev and the password is
'dev' and the other is pw_mgr and the password is 'mgr' Create a regular file called secret.txt 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 60
State whether the following statement is true or false.
If you create your own ansible facts file, it can be executable.

  • A. True
  • B. False

Answer: A

 

NEW QUESTION 61
Create a playbookthatchanges the default target on 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 62
Create a file called specs.empty in home/bob/ansible on the local machine as follows:
HOST=
MEMORY=
BIOS=
VDA_DISK_SIZE=
VDB_DISK_SIZE=
Create the playbook /home/bob/ansible/specs.yml which copies specs.empty to all remote nodes' path
/root/specs.txt. Using the specs.yml playbook then edit specs.txt on the remote machines to reflect the appropriate ansible facts.

Answer:

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

 

NEW QUESTION 63
......

All EX407 Dumps and Training Courses: https://www.real4dumps.com/EX407_examcollection.html