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

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/971c4136298419c18d24a85fedea1058%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to