Você pode aproveitar os playbooks ansiosos para esse tipo de coisa.
por exemplo,
---
- hosts: host1:host2
user: user1
sudo: yes
tasks:
- name: update package list
action: command /usr/bin/apt-get update
- name: upgrade packages
action: command /usr/bin/apt-get -u -y dist-upgrade
- hosts: host3
user: ubuntu
sudo: yes
tasks:
- name: update package list
action: command /usr/bin/apt-get update
- name: upgrade packages
action: command /usr/bin/apt-get -u -y dist-upgrade
Espero que funcione para você:)