<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>

CC BY-SA 3.0
2017-05-05T01:22:41.987Z
2017-05-05T01:22:41.987Z
Berlin
<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>

<ansible><configuration-management>
Execute the whole Playbook serially
Diego Puertas
# 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


---

