HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Execute the whole Playbook serially

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
theseriallywholeplaybookexecute

Problem

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.

Solution

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

Code Snippets

- hosts:
    - web
    - db
  serial: 1
  roles:
    - { role: nginx, when: ansible_os_family == 'Debian' }
    - role2
    - role3

Context

StackExchange DevOps Q#1106, answer score: 1

Revisions (0)

No revisions yet.