Free EX407 Exam Braindumps (page: 7)

Page 6 of 26

Which of the following are valid flags for the ansible-playbook command? (Choose all that apply.)

  1. --include-tags
  2. --tags
  3. --skip-tags
  4. --tag

Answer(s): B,C

Explanation:

The --skip-tags flag allows specification of tags to identify specific plays for Ansible to skip.



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?

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

Answer(s): D

Explanation:

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



Consider the following playbook.
---
- hosts: web1
become: yes

tasks:
- name: use yum
yum:
name=httpd
state=latest

- name: use service
service:
name=httpd
state=started
enabled=yes

- hosts: media1
become: yes

tasks:
- name: use service
service:
name=mariadb
state=started

when:
- ansible_hostname == "web1"
- name: use service
service:
name=firewalld
state=stopped

What service is started on the host media1?

  1. mariadb
  2. httpd
  3. firewalld
  4. No service is started on media1.

Answer(s): D

Explanation:

While there is a service module call that will start mariadb, it will never run due to the always false condition attached to that task.



What module is used to deploy a template?

  1. File
  2. Copy
  3. Template
  4. Deploy

Answer(s): B

Explanation:

The template module is designed to process and deploy template files.






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

EX407 Discussions & Posts