iac/ansible/locust.yml
Aravinth Manivannan c469878daf
feat: rm ufw
configuring a firewall is external to installing mCaptcha, since we use
standard HTTP ports only. Should also make testing with woodpecker CI
easy.
2023-12-11 14:36:14 +05:30

46 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
roles:
- ufw
- name: Configure Locust instances
hosts: [mcaptcha_dos]
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