EX407

EX407 practice questions, page 3 of 4, with answer review and explanations.

Question 11

Consider the following playbook. - hosts: webservers become: yes - name: install httpd yum: name: httpd state: latest Which line includes a syntax error?

  1. become: yes – there is no attribute called become
  2. yum: – yum should be proceeded with a hyphen
  3. The file does not end with end-playbook.
  4. The playbook does not include the task directive.

Question 12

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

  1. name
  2. service
  3. listen
  4. handle

Question 13

What is the primary difference between the shell and command module?

  1. The shell module is for executing shell commands, and the command module is for Ansible internal commands.
  2. The shell module sets up a shell environment and the command module only runs the provided command.
  3. The shell module sets a default shell whereas the command module executes a shell command.
  4. There is no difference.

Question 14

Which command is the correct way to run the playbook /home/ansible/Buildwww.yml using the inventory file /home/ansible/inventory, assuming your present working directory is /home/ansible?

  1. ansible -i inventory Build.yml
  2. ansible -i inventory -p Buildwww.yml
  3. ansible-playbook -i inventory -p Buildwww.yml
  4. ansible-playbook -i inventory Buildwww.yml

Question 15

Which Ansible ad-hoc flag is analogous to the become directive?

  1. b
  2. f
  3. i
  4. B