
The test contains the following Ansible topics:
- Installation
- Playbooks
- Inventory
- Module Index
- Network Modules
- Ansible-Container
An example question:
Considering the below playbook, which tasks will be executed first?
—
– hosts: webservers
remote_user: root
tasks:
– name: ensure apache is at the latest version
yum: name=httpd state=latest
– name: write the apache config file
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
– hosts: databases
remote_user: root
tasks:
– name: ensure postgresql is at the latest version
yum: name=postgresql state=latest
– name: ensure that postgresql is started
service: name=postgresql state=started
Answers:
- apache first and then postgresql
- postgresql first and then apache
- They will both run in parallel
- The order of tasks is not guaranteed
What is Ansible?
Ansible is the simplest way to automate apps and IT infrastructure. Application Deployment + Configuration Management + Continuous Delivery.
Common use cases:
Provisioning cloud infrastructure, deploying application code, managing SSH keys, configuring databases, and setting up web servers.