Ansible Playbooks


Playbooks Overview

  • Playbooks are the main construct within Ansible.
  • Playbooks have a list of Plays.
  • Plays map hosts to tasks. Tasks are basically calls to Ansible modules.
  • Playbooks structure looks like:
    • Playbooks contain Plays.
    • Plays contain Tasks
    • Tasks call Modules.
  • The most basic formal of a playbook is as follows:
- hosts:
  - name:
  - name:
  • host defines which hosts/groups this playbooks should be applied to. This is a list so multiple can be entered separated by colons.
  • vars
  • remote_user defines the users name for accessing the hosts. Remote_user can be used under tasks as well.
  • tasks
    • name is the name of the task, could be anything, as long as it is descriptive.
  • handlers


rating: 0+x
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License