How to run multiple playbooks in order with Ansible?

Solution 1:

Build many sub-playbooks and aggregate them via include statements.

- include: playbook-one.yml
- include: playbook-two.yml

If your playbooks must run in order and if all of them are mandatory, build a main playbook and include files with tasks. A playbook should always be a closed process.

Solution 2:

For newer versions of Ansible, you can build many sub-playbooks and aggregate them via import_playbook statements:

- import_playbook: A-systemd-networkd.yml
- import_playbook: B-fail2ban-ssh.yml
- import_playbook: C-enable-watchdog.yml