Free EX407 Exam Braindumps (page: 4)

Page 3 of 26

Consider the following playbook.

---
- hosts: local
become: yes

tasks:
- name: create users
user: name: "{{item}}" with_items:

- sam
- john
- bob

How many times is the user module invoked?

  1. 5
  2. 3
  3. 1
  4. 0

Answer(s): B

Explanation:

The call count will be based on the number of times the with_items loop executes - which is 3 in this case



What command is used to run a playbook?

  1. ansible-playbook <playbook>
  2. ansible <playbook>
  3. ansible-p <playbook>
  4. playbook <playbook>

Answer(s): A

Explanation:

This command will run a given playbook successfully.



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.

Answer(s): D

Explanation:

The "task:" directive is required at the prior to providing the tasks of a playbook. Without it, Ansible will not throw an error.



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

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

Answer(s): A,C

Explanation:

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






Post your Comments and Discuss RedHat EX407 exam with other Community members:

EX407 Discussions & Posts