Software >> Automation >> Ansible >> Playbook >> What is the playbook structure

 

Ansible Playbook Structure


## Example

---
  # This is a simple playbook with a single play
  - name: a simple play
    host: managedhost.example.com
    user: remoteuser
    become: yes
    become_method: sudo
    become_user: root
    gather_facts: [yes|no]
    tasks:
    - name: first task
      service: name=httpd enabled=true
    - name: second task
      service: name=sshd enabled=true
...


## FORMATTING