Free EX407 Exam Braindumps (page: 5)

Page 4 of 26

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.

Answer(s): B



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

Answer(s): D

Explanation:

This command is the correct way to run the playbook using the requested inventory



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

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

Answer(s): A

Explanation:

The b flag actually stands for become! They both have Ansible escalate to the become_user.



Consider the following playbook:

# playbook name: /home/ansible/web.yml
---
- hosts: webservers
become: yes

tasks:
- name: edit file 1
lineinfile:
path: /var/www/content.hml line: "{{ text }}" tags:
- content
- name: edit file 2
lineinfile: path: /var/www/index.hml
line: "{{ text }}"

tags:
- web
- name: edit file 3
lineinfile:
path: /var/www/etc.hml
line: "{{ text }}"
tags: - content - misc

Which use of the ansible-playbook command on the provided playbook will result in ONLY editing the file /var/ www/index.html?

  1. ansible-playbook /home/ansible/web.yml
  2. ansible-playbook /home/ansible/web.yml --skip-tags web
  3. ansible-playbook /home/ansible/web.yml --skip-tags content
  4. ansible-playbook /home/ansible/web.yml --tags content

Answer(s): C

Explanation:

This command skips the two tasks editing other files and only allows the task that is editing /var/www/index.html to run.






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

EX407 Discussions & Posts