Get The Important Preparation Guide With EX407 Dumps [Q20-Q37]

Share

Get The Important Preparation Guide With EX407 Dumps

Get Totally Free Updates on EX407 Dumps PDF Questions

NEW QUESTION 20
Which of these are valid as the first thing in a playbook? (Choose all that apply.)

  • A. - tasks: name=
  • B. ---
  • C. --- # this is a comment
  • D. - hosts: local

Answer: B,C

 

NEW QUESTION 21
Create a role called sample-apache in /home/sandy/ansible/roles that enables and starts httpd, enables and starts the firewall and allows the webserver service. Create a template called index.html.j2 which creates and serves a message from /var/www/html/index.html Whenever 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 the ip address of the node using ansible facts. Lastly, create a playbook in /home/sandy/ansible/ called apache.yml and use the role to serve the index file on webserver hosts.

Answer:

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 22
Which of the following are valid ways to populate an Ansible Tower project with your source files? (Choose all that apply.)

  • A. file system of the Ansible Tower server
  • B. git
  • C. tar upload
  • D. subversion

Answer: A,B,D

Explanation:
Ansible Tower is able to work with subversion repositories for artifact management. Ansible Tower labels this as a manual project. Ansible Tower is capable of pulling artifacts from a git repository by branch.

 

NEW QUESTION 23
Create a playbook called timesvnc.yml in /home/sandy/ansible using rhel system role timesync. Set the time to use currently configured nip with the server 0.uk.pool.ntp.org. Enable burst. Do this on all hosts.

Answer:

Explanation:
Solution as:

 

NEW QUESTION 24
What type of credential is used for accessing system accounts on your remote Linux hosts via SSH in Ansible Tower?

  • A. Insights
  • B. System
  • C. Ansible Tower
  • D. Machine

Answer: D

Explanation:
This is the appropriate credential for working with remote hosts over SSH.

 

NEW QUESTION 25
Which of the following are shared between roles on the same system? (Choose all that apply.)

  • A. Variables
  • B. Tasks
  • C. Templates
  • D. Handlers

Answer: A,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 26
Which is the default inventory file used by Ansible?

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

Answer: C

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

 

NEW QUESTION 27
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:
/home/sandy/ansible/apache.yml

/home/sandy/ansible/roles/sample-apache/tasks/main.yml

 

NEW QUESTION 28
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 29
What does the -p flag do with the ansible-galaxy command?

  • A. Allows ansible-galaxy to push a role to a target.
  • B. Instructs ansible-galaxy to install the role permanently to persist a reboot.
  • C. Allows ansible-galaxy to pull a role down to the local server.
  • D. Allows the user to provide a role path other than the default to be used when installing a role.

Answer: D

 

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

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

Answer: B,D

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

 

NEW QUESTION 31
Which are of the following are valid uses of a role's meta directory? (Choose all that apply.)

  • A. Setting the allow_duplicates flag.
  • B. A role's dependency information.
  • C. Setting the become flag.
  • D. Setting variable values for use within a role.

Answer: A,B

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 32
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 33
Which are of the following are valid uses of a role's meta directory? (Choose all that apply.)

  • A. Setting the allow_duplicates flag.
  • B. A role's dependency information.
  • C. Setting the become flag.
  • D. Setting variable values for use within a role.

Answer: A,B

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 34
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 35
Create a playbook called regulartasks.yml which has the system that append the date to /root/datefile every day at noon. Name is job 'datejob'

Answer:

Explanation:
Solution as:

 

NEW QUESTION 36
State whether the following statement is true or false.
A template can only use 1 variable.

  • A. True
  • B. False

Answer: B

Explanation:
You can use multiple variables in templates.

 

NEW QUESTION 37
......

Prepare With Top Rated High-quality EX407 Dumps For Success in Exam: https://www.examtorrent.com/EX407-valid-vce-dumps.html

EX407 Free Certification Exam Easy to Download PDF Format 2022: https://drive.google.com/open?id=1zGP1FkYbccRX-lQ3auBU4NjRzb4YOpqy