I have a scenario, where I want a task to run on all available hosts. To describe: lets say I have 3 hosts and each host running 4 agents each using docker, so total I got 12 agents now.
My rspec tests run in parallel mode using all 12 agents.
Now before running the rspec tests(which uses a docker image), I build a test docker image, but this task of building of test-image should be run on all 3 hosts as the test-image will be required on all 3 hosts, when the tests run.
Right now, I have specified three tasks in my pipeline to build the test-image on all 3 hosts, to ensure image is available, but when I plan to horizontally scale and increase my hosts along with the agents, I will have to add extra steps in pipeline.yml to build image on those hosts.
Is there any better way to work this out, by which I can ensure my building of test image task runs on all available hosts