- name: fast hosts: 127.0.0.1 become: yes tasks: - name: Install Python Virtualenv apt: name: python3-virtualenv state: present - name: Install docker-compose apt: name: docker-compose state: present - name: Pull PostgreSQL Docker Image docker_image: name: postgres:alpine source: pull - name: Run PostgreSQL Container docker_container: name: fastdb image: postgres:alpine env: POSTGRES_DB: fast POSTGRES_USER: admin POSTGRES_PASSWORD: admin ports: - "5432:5432" detach: yes - name: Create ~/fast directory file: path: ~/fast state: directory become: yes - name: Copy server.yaml and submitter.py to fast directory copy: src: "./fast/server.yaml" dest: ~/fast/server.yaml become: yes - name: Copy file2 to ~/fast copy: src: "./fast/submitter.py" dest: ~/fast/submitter.py become: yes - name: Install fast package in the virtual environment pip: name: https://github.com/dusanlazic/fast/releases/download/v1.1.0-czechia/fast-1.1.0-czechia.tar.gz virtualenv: ~/fast-venv - name: tulip hosts: 127.0.0.1 become: yes tasks: - name: Clone tulip repository from GitHub git: repo: https://github.com/OpenAttackDefenseTools/tulip dest: ~/tulip force: yes - name: Copy tulip.env to .env copy: src: "./tulip/tulip.env" dest: ~/tulip/.env - name: Apply the Docker Compose patch patch: src: "./tulip/0001-restart-always.patch" dest: ~/tulip/docker-compose.yml - name: Build and run Docker containers with Docker Compose docker_compose: project_src: ~/tulip become: yes - name: nginx hosts: 127.0.0.1 become: yes tasks: - name: Install Nginx apt: name: nginx state: present - name: Configure Nginx for fast.ctf.rs and tulip.ctf.rs template: src: "./nginx/ctf.rs.conf" dest: /etc/nginx/sites-available/ctf.rs.conf notify: Reload Nginx - name: Enable Nginx sites file: src: /etc/nginx/sites-available/ctf.rs.conf dest: /etc/nginx/sites-enabled/ctf.rs.conf state: link notify: Reload Nginx handlers: - name: Reload Nginx service: name: nginx state: reloaded