Answers: <p>I think Ansible serial works only for the entire play, have you tried to use roles ?</p>
  
  <p>For example:</p>
  
  <pre><code>- hosts:
      - web
      - db
    serial: 1
    roles:
      - { role: nginx, when: ansible_os_family == 'Debian' }
      - role2
      - role3
  </code></pre>
  
Answers: CC BY-SA 3.0
Answers: 2017-05-05T01:22:41.987Z
Answers: 2017-05-05T01:22:41.987Z
Answers: Berlin
Body: <p>Adding <code>serial: 1</code> to a Play will execute that one Play one host at a time. Is there something similar for the whole playbook?</p>
  
  <p>That is, all plays will execute only in one host, and when they are finished then all plays will execute on the next host, an so on.</p>
  
Tags: <ansible><configuration-management>
Title: Execute the whole Playbook serially
UserDisplayName: Diego Puertas
ThreadText: # Execute the whole Playbook serially
  
  (Asked by: username_0 on 2017-05-04)
  
  Adding `serial: 1` to a Play will execute that one Play one host at a time. Is there something similar for the whole playbook?
  
  That is, all plays will execute only in one host, and when they are finished then all plays will execute on the next host, an so on.
  
  **Tags:** ansible, configuration-management
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-05-05. Score: 1
  
  I think Ansible serial works only for the entire play, have you tried to use roles ?
  
  For example:
  
  ```
  - hosts:
      - web
      - db
    serial: 1
    roles:
      - { role: nginx, when: ansible_os_family == 'Debian' }
      - role2
      - role3
  
  ```
  
  
  ---
  
  