Locust is an easy-to-use, distributed, user load testing tool. It is intended for load-testing web sites (or other systems) and figuring out how many concurrent users a system can handle. With this repo you can run locust automatically with ansible without any dependency on cloud servers or fresh remote hosts in master slave (distributed) mode.
Edit the hosts file and add yor hosts on this file make your locust file.
Run the following commands with replace the host site and master server ip
ansible locust-all -i hosts -u root -m raw -a 'DEBIAN_FRONTEND=noninteractive apt update && apt -y install python'
ansible-playbook -i hosts locust.yaml
ansible locust-master -i hosts -u root -m shell -a 'locust -f locustfile.py --master --host=https://example.com'
ansible locust-slaves -i hosts -u root -m shell -a 'locust -f locustfile.py --slave --master-host={{ MASTER_IP }}'