red hat certified specialist in ansible automation (ex407 prep …... · 2020. 10. 29. · question...

159
Red Hat Certified Specialist in Ansible Automation (EX407 Prep Guide Flash Cards

Upload: others

Post on 22-Aug-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Red Hat Certified Specialist in  Ansible Automation (EX407 Prep Guide

Flash Cards

Page 2: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 1 True or False: A host in an inventory may only be part of one host group.

Page 3: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: False. A host can be in any number of groups

Page 4: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 2 What file formats are valid for Ansible custom fact files?

Page 5: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: INI,JSON, or an executable that return JSON.

Page 6: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 3 Will the following ansible command fail:

‘ansible all -a "mkdir/tmp/testfile" ’

Page 7: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer:

No! When not used with the module flag, the argument flag will simple run commands supplied via the argument flag directly against a target hosts (as long as they are valid commands).

Page 8: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 4 What does max_failure_percentage set a threshold for?

Page 9: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The maximum number of host failures that ansible will allow before stopping the play

Page 10: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 5 What module would you use to create a new system user?

Page 11: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The user module.

Page 12: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 6 Expand web[0103.example.com

Page 13: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: web01.example.com web02.example.com web03.example.com

Page 14: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 7 True or False: Parallelism allows Ansible to act on multiple hosts simultaneously.

Page 15: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: True! Parralellism is accomplished in Ansible by forking the Ansible process which allows many copies of Ansible to act at one time against many hosts.

Page 16: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 8 What keyword makes ansible continue a play execution despite a task failure?

Page 17: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ignore_errors: yes

Page 18: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 9 True or false: ‘ansible-doc - - list’ is a quick way to a module listing on a system.

Page 19: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: False. ‘Ansible-doc - -list’ is a rather slow to run.

Page 20: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 10 What is the use of a machine credential in Ansible Tower?

Page 21: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The machine credential is used to supply a username and password (or ssh key) to access remote systems for use with ansible.

Page 22: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 11 Ansible Tower provides what kind of interface to Ansible?

Page 23: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: A web interface!

Page 24: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 12 How can you make a task conditional on a binary expression?

Page 25: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The ‘when’ keyword.

Page 26: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 13 How would you install the galaxy role named ‘awesome’ published by the user ‘stallman’?

Page 27: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘ansible-galaxy install stallman.awesome’

Page 28: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 14 True or false: Ansible always runs 15% more forks than the number of hosts it is executing against.

Page 29: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: False. Ansible always run the minimum number of forks it requires.

Page 30: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 15 Not considering command line defined variables, what variable definition takes the highest precedence in an ansible role?

Page 31: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Variables defined in the ‘vars’ directory of a role.

Page 32: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 16 What two ansible-vault sub-commands allow you to edit an already encrypted file and see the contents of an encrypted file?

Page 33: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘Edit’ and ‘view’, respectively.

Page 34: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 17 What flag allows you provide a non-default role path?

Page 35: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The ‘-p’ flag.

Page 36: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 18 What command is used to run ad-hoc ansible commands?

Page 37: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘ansible’

Page 38: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 19 If you know Ansible is retrieving variables from a file called ‘./host_vars/Johnny’ , what host must exists in the inventory?

Page 39: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: There must be a host named Johnny. Ansible checks ‘host_vars/‘ for files by host names within the inventory.

Page 40: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 20 How does Ansible group a common set of tasks, variables, files, and handlers?

Page 41: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: With Ansible Roles!

Page 42: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 21 Which Ansible variable type allows for key-value pairs?

Page 43: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: A dictionary variable

Page 44: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 22 True or False: By default, playbooks gather facts on execution.

Page 45: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: True! Though you can disable fact gathering

Page 46: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 23 What is the module index?

Page 47: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The comprehensive online listing of available ansible modules.

Page 48: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 24 True or False: Handles and variables are shared between all roles on the system.

Page 49: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: True.

Page 50: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 25 What ‘ansible-vault’ command will encrypt a file named

"classified" ?

Page 51: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘ansible-vault encrypt classified’

Page 52: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 26 True or False: The ansible-galaxy command can only pull roles from galaxy.ansible.com.

Page 53: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: False! The command can use any GitHub repo that is has credentials for.

Page 54: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 27 True or False: ‘ad-hoc’ commands may be run from a tower project.

Page 55: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: False! There is not an option to run an ‘ad-hoc’ command from the project menu.

Page 56: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 28 True or False: It is not possible to provide more than one vault password when executing an Ansible playbook.

Page 57: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: False. As of Ansible 2.4, the vault-id feature allows for multiple passwords to be used in a single playbook execution.

Page 58: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 29 What is the data format returned by Ansible modules?

Page 59: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: JSON

Page 60: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 30 True or False: Ansible variables may be defined in external files.

Page 61: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: True! But the file must be included using either the vars_file keyword or through a command line switch.

Page 62: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 31 What is the command to return information on the htpasswd module?

Page 63: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘Ansible-doc htpasswd’

Page 64: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 32 What keyword is used to pass parameters to an Ansible role?

Page 65: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘vars:’

Page 66: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 33 What does the keyword ‘changed_when’ do?

Page 67: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: It allows you to have Ansible mark a certain task result "changed" presuming the accompanying conditional returns true.

Page 68: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 34 What directory does Ansible Tower use to look for project artifacts by default when configured to use a manual project?

Page 69: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The directory set in PROJECTS_ROOT.

Page 70: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 35 What is the best way to manage a config file with Ansible?

Page 71: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Ansible Template

Page 72: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 36 What is the processing langue for ansible templates?

Page 73: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Jinja2

Page 74: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 37 If you know Ansible is retrieving variables from a file called ‘./group_vars/webservers’ , what group must exist in the inventory?

Page 75: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘Webservers’ , because the files for group_vars must be named after the group.

Page 76: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 38 What facts are contained in the ansible_local variable?

Page 77: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Custom facts defined on remote systems using facts.d.

Page 78: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 39 What are the three flags that allow you to specify a password that will allow ansible to successfully use ansible-vault encrypted files?

Page 79: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘ask-vault-password’ , ‘ask-vault-file’ , and ‘vault-id’

Page 80: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 40 What flag does the ansible-playbook command take that will cause the command to only run against a specified host?

Page 81: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The ‘- -limit’ flag.

Page 82: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 41 What makes an Ansible inventory dynamic?

Page 83: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: It is an executable file! Script or binary)

Page 84: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 42 What are the two required parameters for the template module?

Page 85: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: I -src -dest

Page 86: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 43 What directories may be used by an Ansible role?

Page 87: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: I -tasks -handlers -vars -defaults -files -templates -meta.

Page 88: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 44 What Ansible module can write to stdout and stderr on the ansible control node during play execution?

Page 89: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The debug module.

Page 90: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 45 What three keywords work together to provide "try / catch" style error handling?

Page 91: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: I -block -rescue -always

Page 92: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 46 What types of items may be in an Ansible inventory?

Page 93: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Hosts, groups, and variable declarations.

Page 94: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 47 What do the terms ‘install’, ‘init’ , ‘remove, and ‘search’ have in common when it comes to Ansible?

Page 95: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: They are all sub commands of the ansible-galaxy command.

Page 96: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 48 What format must be returned by an Ansible dynamic inventory?

Page 97: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: JSON

Page 98: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 49 How can you manipulate text output from Ansible variables?

Page 99: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Using a Jinja filter.

Page 100: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 50 True or False: Ansible Tower is installed with Ansible Core.

Page 101: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: False. Ansible Tower is only available stand-alone.

Page 102: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 51 What keyword must be set to true in order to allow a role to be applied more than once within a play?

Page 103: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘allow_duplicates’

Page 104: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 52 Which flag is used to specify the arguments that pass to a module for the ansible command?

Page 105: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘-a’

Page 106: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 53 What is the script name that kicks off the Ansible Tower install?

Page 107: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘setup.sh’

Page 108: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 54 Is it possible to use a directory as an Ansible inventory?

Page 109: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Yes! If you provide a directory as your inventory Ansible will use all of the valid inventories it finds in that directory (static or dynamic).

Page 110: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 55 What Ansible modules allow one to insert text into an existing file?

Page 111: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘Lineinfile’

Page 112: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 56 What does the template module do?

Page 113: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Deploys ansible templates.

Page 114: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 57 What are the two ways you can supply a vault password using ‘- -vault-id’?

Page 115: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: You may specify a password file using ‘label@fileName’ or you may have ansible prom using ‘label@prompt’

Page 116: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 58 What inventory file does the following command use: ‘ansible webservers -m setup’

Page 117: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The default inventory file

Page 118: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 59 What keyword allows you to batch play execution by hosts?

Page 119: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The serial keyword.

Page 120: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 60 What ansible-vault sub-command allows you to encrypt a single string?

Page 121: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Encrypt-string

Page 122: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 61 Using source control is the preferred way to set up what Ansible Tower artifact?

Page 123: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: A Tower project.

Page 124: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 62 What flags must be handled by the dynamic inventory in Ansible?

Page 125: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: - - list - - host <HOSTNAME>

Page 126: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 63 Ansible Variable names should only be made of what?

Page 127: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘Letters, number, and underscores.’

Page 128: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 64 With no extra options, how does ansible-doc present output?

Page 129: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: In a less like text viewing application.

Page 130: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 65 What is the Ansible module used to validate host connectivity?

Page 131: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘Ping’

Page 132: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 66 What does the filter parameter for for the setup module?

Page 133: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: It allows you to filter Ansible facts returned using a regular expression.

Page 134: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 67 Which Ansible role directories do not require a main.yml if they are being used?

Page 135: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘Templates’ and ‘files’

Page 136: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 68 What Ansible module runs a command against a remote host with no environment set up?

Page 137: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The command module.

Page 138: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 69 This Ansible role directory is primarily used to define role dependencies.

Page 139: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The ‘meta’ directory.

Page 140: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 70 How do you change the name of an Ansible role?

Page 141: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Rename the directory that defines the role.

Page 142: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 71 What is the Ansible command that gathers facts for all servers in the webservers group (assume default inventory file)?

Page 143: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: ‘Ansible webservers -m setup’

Page 144: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 72 What are the required parameters for the service module?

Page 145: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: Only a name.

Page 146: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 73 What flag sets the fork count for an ansible ‘ad-hoc’ command?

Page 147: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: -f <NUM_FORKS>

Page 148: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 74 Where does ansible-galaxy install roles by default?

Page 149: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: /etc/ansible/roles

Page 150: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 75 Ansible variable names may only start with what?

Page 151: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: A letter.

Page 152: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 76 What Ansible module installs software on Red Hat systems?

Page 153: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: The yum module.

Page 154: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 77 True or False: The number of forks will limit how many hosts that a play with serial defined can execute on.

Page 155: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: True. Ansible will never make more than the maximum number of forks, even if serial is defined higher than that number in a play.

Page 156: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 78 True or false: Ansible variables may be prompted during play execution.

Page 157: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: True! Using the vars_prompt keyword.

Page 158: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Question 79 What file extension must be used for custom Ansible fact files?

Page 159: Red Hat Certified Specialist in Ansible Automation (EX407 Prep …... · 2020. 10. 29. · Question 1 True or False: A host in an inventory may only be part of one host group

Answer: .fact