EX407 practice questions, page 3 of 4, with answer review and explanations.
Question 11
Consider the following playbook. - hosts: webservers become: yes - name: install httpd yum: name: httpd state: latest Which line includes a syntax error?
become: yes – there is no attribute called become
yum: – yum should be proceeded with a hyphen
The file does not end with end-playbook.
The playbook does not include the task directive.
Question 12
Which of the following attributes specifies how a handler can be notified? (Choose all that apply.)
name
service
listen
handle
Question 13
What is the primary difference between the shell and command module?
The shell module is for executing shell commands, and the command module is for Ansible internal commands.
The shell module sets up a shell environment and the command module only runs the provided command.
The shell module sets a default shell whereas the command module executes a shell command.
There is no difference.
Question 14
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?
ansible -i inventory Build.yml
ansible -i inventory -p Buildwww.yml
ansible-playbook -i inventory -p Buildwww.yml
ansible-playbook -i inventory Buildwww.yml
Question 15
Which Ansible ad-hoc flag is analogous to the become directive?