iac/ansible/locust.yml

47 lines
1 KiB
YAML
Raw Normal View History

2023-10-13 16:28:38 +05:30
---
2023-08-17 05:06:08 +05:30
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
2023-10-13 16:28:38 +05:30
- name: Base configuration
ansible.builtin.import_playbook: base.yml
roles:
- ufw
2023-08-17 05:06:08 +05:30
- name: Configure Locust instances
hosts: [mcaptcha_dos]
pre_tasks:
- name: Ensure all VMs are reachable
ansible.builtin.ping:
roles:
2023-10-13 16:28:38 +05:30
- docker
- docker_compose
2023-08-17 05:06:08 +05:30
tasks:
- name: Allow port 8089 for locust
become: true
community.general.ufw:
state: enabled
rule: allow
proto: tcp
port: "8089"
- name: Create projects dir
become: true
ansible.builtin.file:
path: /etc/locust
state: directory
mode: "0755"
- name: Copy docker-compose.yml file
become: true
ansible.builtin.copy:
2023-10-13 16:28:38 +05:30
src: ./artifacts/locust/docker-compose.yml
2023-08-17 05:06:08 +05:30
dest: /etc/locust/
- name: Start locust services
become: true
community.docker.docker_compose:
project_src: /etc/locust/
scale:
worker: 4