How to sequentially execute a Ansible Playbook for each host

To deploy configuration on remote hosts, i use a Ansible Playbook but sometimes, they are behind VPN, so i run script on localhost to configure and create vpn. The problem is i need to sequentially execute a Ansible Playbook for each host and I notice is that the Foreman does a complete ansible-playbook execute for each host individually.

For example, Ansible do that with module “serial : 1” to run one by one.

Is there anything similar on Foreman ?

Hi,
I’m afraid not. as you noticed Foreman ansible runs a single instance of ansible-playbook per host. That means there’s no way to configure it inside the playbook and also there’s no possibility to “make the playbook run wait for others” as it doesn’t know anything about others.

This could in theory be done using the ansible-runner support which landed recently, which runs a single process for a batch (100 if I recall) hosts.