Download Red Hat Certified Specialist in Ansible Automation.EX407.ActualTests.2021-08-16.101q.vcex

Vendor: RedHat
Exam Code: EX407
Exam Name: Red Hat Certified Specialist in Ansible Automation
Date: Aug 16, 2021
File Size: 66 KB
Downloads: 2

How to open VCEX files?

Files with VCEX extension can be opened by ProfExam Simulator.

Demo Questions

Question 1
Examine the following inventory excerpt file named /home/user/ansible/inventory. [dbservers] 
db1.example.com  
  
  
Which of the following files does Ansible check for variables related to that inventory? (Choose all 
that apply.)
  1. /home/user/ansible/dbservers
  2. /home/user/ansible/host_vars/db1.example.com
  3. /home/user/ansible/host_vars/db1
  4. /home/user/ansible/group_vars/dbservers
Correct answer: BD
Explanation:
Ansible will check in /home/user/ansible/host_vars to find files named after hosts defined in the inventory. Ansible will check this file because there is a group defined in the inventory as dbservers.      Reference: https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#understanding-variable-precedence
Ansible will check in /home/user/ansible/host_vars to find files named after hosts defined in the inventory. Ansible will check this file because there is a group defined in the inventory as dbservers.    
  
Reference: 
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#understanding-variable-precedence
Question 2
Which flags must be accepted as input for a dynamic inventory script?
  1. Only --list
  2. --host [hostname] and --list
  3. --host [hostname] and --inv-list
  4. --list and --format [file format]
Correct answer: B
Explanation:
Reference:https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html#inventory-script-conventions
Reference:
https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html#inventory-script-conventions
Question 3
A dynamic inventory must return data in what format?
  1. JSON
  2. XML
  3. YAML
  4. INI
Correct answer: A
Explanation:
Dynamic inventories must return JSON output.     Reference:https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html#inventory-script-conventions
Dynamic inventories must return JSON output.   
  
Reference:
https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html#inventory-script-conventions
Question 4
Which is the default inventory file used by Ansible?
  1. ${PWD}/.inventory
  2. /etc/hosts
  3. /etc/ansible/inventory
  4. /etc/ansible/hosts
Correct answer: D
Explanation:
Ansbile refers to /etc/ansible/hosts as the default inventory.     Reference: https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#how-to-build-your-inventory
Ansbile refers to /etc/ansible/hosts as the default inventory.   
  
Reference: https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#how-to-build-your-inventory
Question 5
Observe the details of the following dynamic inventory file.  
 
$ ls -l dynamic.py -rw-rw-r--. 1 user user 1928 Mar 30 08:21 dynamic.py 
    
Why will this inventory file cause the ansible command to fail?
  1. Ansible cannot use python scripts as inventories.
  2. The ansible user must own the file.
  3. The file is not executable.
  4. The ansible command will not fail using the noted file with the given details. 
Correct answer: C
Explanation:
Without being executable. Ansible will attempt to parse the script as a static inventory and fail.
Without being executable. Ansible will attempt to parse the script as a static inventory and fail.
Question 6
Is it possible to specify multiple inventory files at once?
  1. Yes, you specify your inventory as a directory containing valid inventory files.
  2. No.
  3. Yes, you must provide extra parameters to the -i flag.
  4. Yes, you must specify a reference inventory master file.
Correct answer: A
Explanation:
Reference: https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#using-multiple-inventory-sources
Reference: https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#using-multiple-inventory-sources
Question 7
What keyword stores a command's output into a variable?
  1. register
  2. output
  3. output is stored in a variable named results by default 
  4. debug
Correct answer: A
Explanation:
The register keyword will store output from the preceding command into a provided variable.  Reference:https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#registering-variables
The register keyword will store output from the preceding command into a provided variable. 
Reference:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#registering-variables
Question 8
What does the lineinfile module do?
  1. Allow addition of lines anywhere in a file
  2. Allows to grep for lines in a provided file
  3. Allow additions of lines to the end of a file only
  4. Input data into a file from stdin
Correct answer: A
Explanation:
The purpose of the lineinfile module is to add lines anywhere in a file passed on a pattern.     Reference:https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html#synopsis
The purpose of the lineinfile module is to add lines anywhere in a file passed on a pattern.   
  
Reference:
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html#synopsis
Question 9
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
Correct answer: B
Explanation:
The call count will be based on the number of times the with_items loop executes - which is 3 in this case     Reference: https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html
The call count will be based on the number of times the with_items loop executes - which is 3 in this case     
Reference: https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html
Question 10
What command is used to run a playbook?
  1. ansible-playbook <playbook>
  2. ansible <playbook>
  3. ansible-p <playbook>
  4. playbook <playbook>
Correct answer: A
Explanation:
This command will run a given playbook successfully.     Reference: https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#running-playbooks
This command will run a given playbook successfully.     
Reference: https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#running-playbooks
HOW TO OPEN VCE FILES

Use VCE Exam Simulator to open VCE files
Avanaset

HOW TO OPEN VCEX AND EXAM FILES

Use ProfExam Simulator to open VCEX and EXAM files
ProfExam Screen

ProfExam
ProfExam at a 20% markdown

You have the opportunity to purchase ProfExam at a 20% reduced price

Get Now!