> When I set serial:1 for one of the plays in a playbook, the whole
> playbook
> is then processed one host at a time.
> Is this the intended behaviour?
I can't confirm this on 2.3.1
> Is it possible to apply serial:1 only to one play?
> E.g. if I have a playbook comprising three plays: p1, p2 (with
> serial:1)
> and p3 then p1 and p3 would be executed in parallel across relevant
> hosts
> and the p2 would run sequentially for each host.
It does work like that.
playbook.yml
---
- name: p1
hosts: all
tasks:
- name: Task p1
raw: hostname
- name: p2
hosts: all
serial: 1
tasks:
- name: Task p2
raw: hostname
- name: p3
hosts: all
tasks:
- name: Task p3
raw: hostname
Result:
PLAY [p1] ******************************
TASK [Task p1] *************************
changed: [a1]
changed: [a2]
PLAY [p2] ******************************
TASK [Task p2] *************************
changed: [a1]
PLAY [p2] ******************************
TASK [Task p2] *************************
changed: [a2]
PLAY [p3] ******************************
TASK [Task p3] *************************
changed: [a2]
changed: [a1]
--
Kai Stian Olstad