crowdsec/test/ansible/provision_test_suite.yml
mmetc a19748ae35
Rename directory "tests" to "test" (#2094)
If you use a ./test/local directory, you need to create it again:
$ make clean bats-build bats-fixture
2023-03-03 15:54:49 +01:00

35 lines
1.1 KiB
YAML

# vim: set ft=yaml.ansible:
---
- name: "Fetch the test scripts"
hosts: all
tasks:
- name: "Fetch the sources from a git repository"
ansible.builtin.include_role:
name: crowdsecurity.testing.download_sources_from_git
when: sources_zip | length == 0
- name: "Extract the sources from a zip archive"
ansible.builtin.include_role:
name: crowdsecurity.testing.extract_sources_from_zip
when: sources_zip | length > 0
- name: "Create crowdsec test/local dir"
become: false
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/crowdsec/test/local"
state: directory
mode: 0o755
vars:
sources_dest_dir: "{{ ansible_env.HOME }}/crowdsec"
sources_git_repo: >-
{{ lookup('ansible.builtin.env', 'TEST_SUITE_GIT')
| default('https://github.com/crowdsecurity/crowdsec', True) }}
sources_git_version: >-
{{ lookup('ansible.builtin.env', 'TEST_SUITE_VERSION')
| default('master', True) }}
sources_zip: >-
{{ lookup('ansible.builtin.env', 'TEST_SUITE_ZIP') }}