45 lines
1 KiB
YAML
45 lines
1 KiB
YAML
---
|
|
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
- name: Base configuration
|
|
ansible.builtin.import_playbook: base.yml
|
|
|
|
- name: Configure Locust instances
|
|
hosts: [mcaptcha_dos]
|
|
remote_user: atm
|
|
pre_tasks:
|
|
- name: Ensure all VMs are reachable
|
|
ansible.builtin.ping:
|
|
roles:
|
|
- docker
|
|
- docker_compose
|
|
|
|
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:
|
|
src: ./artifacts/locust/docker-compose.yml
|
|
dest: /etc/locust/
|
|
|
|
- name: Start locust services
|
|
become: true
|
|
community.docker.docker_compose:
|
|
project_src: /etc/locust/
|
|
scale:
|
|
worker: 4
|