We recently released a new online test in Ansible 2.4!

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:

  1. apache first and then postgresql
  2. postgresql first and then apache
  3. They will both run in parallel
  4. 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.