Linkedin: Learning Ansible: Chapter Quizzes

1. What is Ansible?

Q: What characterized server administration teams many years ago as compared to the same teams today?
A: Their functions were further separated from other IT teams.

Q: What does Ansible require in order to connect to a remote system?
A: An SSH connection between the control node and the remote system.

Q: Which Ansible service is paid?
A: Ansible Tower.

2. Why choose Ansible?

Q: Ansible is written in which programming language?
A: Python

Q: Which function is an example of where an Ansible plug-in can be used?
A: Dynamically update the hosts file.

3. Getting Started with Ansible

Q: Assuming the Python and pip preconditions are fulfilled, which command installs Ansible on a Mac?
A: sudo pip3 install ansible

Q: Which playbook excerpt represents an Ansible task that uses the yum module?
A: 
tasks:
  - name: my task
    yum:
      name: httpd
      state: latest
  
Q: When you follow the sequence of recommended commands to install Ansible on Ubuntu, what should come instead of the ??? placeholder in the specified command?
sudo apt-add-repository ???
A: 
--yes --update ppa:ansible/ansible

4. Working with Ansible.

Q: What is the minimum number of parameters expected by the Ansible ping module?
A: The ping module can run without parameters.

Q: In your playbook, which parameters will you provide to the find module if you want to find all files under the /var/tmp directory?
A: 
path: /var/tmp
file_type: file

Q: Which flag can you add to an ad hoc Ansible execution call to see more details?
A: -v

Q: Which statement is false regarding Ansible playbooks?
A: Playbooks can be written in any syntax, as long as it is textual.

Q: When running an Ansible command ad hoc in the terminal, which argument flags will you use to specify the module to run as well as its parameters?
A: -m and -a

Q: How do you define a subgroup consisting of the host groups cluster1 and cluster2?
A:
[clusters:children]
cluster1
cluster2

5. What Can Ansible Do For You?

Q: To allow remote management, which file on the remote system should include the SSH key for the control node?
A: authorized_keys

Q: Which statement is true regarding modern cloud infrastructure?
A: Cloud infrastructure usually involves different OSs.

Q: When will you want to set the changed_when conditional to true?
A: When a task should be treated as though it caused a change.

Q: What does the following task do?
apt:
  name:
  - ntp
  state: present

A: Install the NTP service, only if it is needed.

Q: In an Ansible playbook, what is the impact of setting serial: 1?
A: All tasks must complete on one server before moving to the next server.

Q: Why should you enable the strategy: free option?
A: For continuation of the play on a host, without waiting for other hosts.

Q: Which ad hoc argument flag will you use to set the number of forks to 10?
A: -f 10

Comments