Getting started with Ansible
Ansible is an IT automation tool. It allows you to automate the running of commands on multiple servers. In a typical use-case scenario, you run Ansible commands on your local computer, and Ansible will perform commands on any number of remote hosts.
How does it work?
Ansible runs locally (eg on your local computer); it will then ssh into designated hosts (generally remote servers, but the local host is also supported) and run predetermined commands on these hosts.
With Ansible, you describe the state you wish your hosts to be in (eg this user account must exist, this package must be installed, this directory must have these permissions, etc.). Whenever Ansible is run against these hosts, it will check that the state of each host coincides with the expected state, and update the host(s) as required.
Main concepts
A host is a server which needs to be configured via Ansible. Typically, this is a remote server, but the local host (ie the one on which Ansible is installed and from which Ansible commands are run) can also be a target host. The inventory refers to the collection of hosts; for cloud-based hosts, dynamic inventory is possible.
A playbook is a sequence of operations that you wish to perform on your hosts. For example: setting up a server, deploying an app, etc.
A module is a built-in action that can be performed by Ansible. Modules are the basic building-block of Ansible.
A task is an atomic action performed by Ansible on hosts. A task will invoke a module.
A role is a custom operation that Ansible can perform on a host. A role will invoke a sequence of tasks. Ansible Galaxy provides a large number of community-sourced roles. You can and should create your own roles. Roles are meant to be re-usable across playbooks
A playbook represents