Ansible

A complete introduction into infrastructure-as-code with Ansible.

Ansible is one of the most popular and powerful ways to work with infrastructure-as-code. It can be used for many purposes, like system configuration, provisioning, orchestration and more. After following this course, you will know all that ansible has to offer, and will be able to write playbooks to manage your infrastructure.
2 days
ansible ansible
Anyone with basic experience managing systems manually
Cover all core feature of Ansible so that participants will be able to provision, configure, and manage systems.
In-classroom or virtual. The entire course is hands-on with lots of exercises using a cloud-based set of virtual machines to practice with.
Need this for your dev team?

Outline

Day 1, morning

Intro

  • Course intro, overview, introductions
  • Ansible intro

First steps

  • Ansible inventory and hosts file
  • The ansible configuration file
  • Understanding ssh key-based authentication
  • Running single ansible modules from the command line
  • YAML introduction (incl. dicts, lists, understanding indentation)

Tools

  • Ansible-navigator
  • Ansible-lint

Day 1, afternoon

Modules

  • Understanding modules
  • Setting module parameters and desired state
  • Overview of available modules
  • Deploying files
  • Managing Packages (linux)
  • Managing users (linux)
  • Managing Services (linux)
  • Overview of windows modules
  • Overview of networking modules
  • Overview of storage modules

Playbooks

  • Playbooks: running multiple tasks against a group of hosts
  • Correctly aligning blocks
  • Host patterns and groups
  • Super user and become

Facts, variables, logic

  • Facts
  • Custom facts
  • Variables, host variables
  • Using variables (conditionals; debug msg)
  • Loops

Day 2, morning

Jinja

  • Understanding Jinja templates (mainly variables, for/if, filters)
  • Deploying templates
  • Using jinja features in playbooks

More about tasks and playbooks

  • Best practices
  • Running shell commands
  • Setting variables based on module results/output
  • Handlers
  • Error handling

Day 2, afternoon

Roles

  • Creating roles
  • Directory layout of a Role (vars, files, tasks, handlers)
  • Dependencies, include and import
  • Ansible Galaxy

Advanced topics

  • Using Ansible Vault
  • Optimizing execution speed and async tasks
  • Overview of ansible automation platform

Not covered

  • Writing a custom ansible module in python
Adapt this course to fit your needs