crowdsec/test/ansible/provision_dependencies.yml
Manuel Sabban f0f27ee5cb
add decently new version of python for centos 7 and 8 for testing (#3053)
* add decently new version of python for centos 7 and 8
* update ansible requirements
2024-06-04 22:39:13 +02:00

92 lines
2.6 KiB
YAML

# vim: set ft=yaml.ansible:
---
- name: "Fix EOL'd centos Stream 8"
hosts: all
tasks:
- name: "update repositories file"
ansible.builtin.find:
paths: /etc/yum.repos.d
patterns: "*.repo"
register: "repo_files"
when:
- ansible_facts.distribution == "CentOS"
- ansible_facts.distribution_major_version == '8'
- name: Replace old text with new text
become: true
ansible.builtin.replace:
path: "{{ item.path }}"
regexp: 'mirrorlist'
replace: '#mirrorlist'
loop: "{{ repo_files.files }}"
when:
- ansible_facts.distribution == "CentOS"
- ansible_facts.distribution_major_version == '8'
- repo_files.matched > 0
- name: Replace old text with new text
become: true
ansible.builtin.replace:
path: "{{ item.path }}"
regexp: '#baseurl=http://mirror.centos.org'
replace: 'baseurl=https://vault.centos.org'
loop: "{{ repo_files.files }}"
when:
- ansible_facts.distribution == "CentOS"
- ansible_facts.distribution_major_version == '8'
- repo_files.matched > 0
- name: "Install required packages"
hosts: all
vars_files:
- vars/go.yml
roles:
- crowdsecurity.testing.apt_update
- crowdsecurity.testing.go
- crowdsecurity.testing.machine_id
- crowdsecurity.testing.epel
- crowdsecurity.testing.git
- crowdsecurity.testing.gcc
- crowdsecurity.testing.gnu_make
- crowdsecurity.testing.pkg_config
- crowdsecurity.testing.re2
- crowdsecurity.testing.bats_requirements
- name: "Install recent python"
hosts: all
vars_files:
- vars/python.yml
tasks:
- name: role "crowdsecurity.testing.python3"
ansible.builtin.include_role:
name: crowdsecurity.testing.python3
when:
- ansible_facts.distribution in ['CentOS', 'OracleLinux']
- ansible_facts.distribution_major_version == '8' or ansible_facts.distribution_major_version == '7'
- name: "Install Postgres"
hosts: all
become: true
vars_files:
- vars/postgres.yml
tasks:
- name: role "geerlingguy.postgresql"
ansible.builtin.include_role:
name: geerlingguy.postgresql
## enable this for debugging
# vars:
# postgres_users_no_log: false
when:
- lookup('ansible.builtin.env', 'DB_BACKEND') in ['pgx', 'postgres']
- name: "Install MySQL"
hosts: all
become: true
vars_files:
- vars/mysql.yml
tasks:
- name: role "geerlingguy.mysql"
ansible.builtin.include_role:
name: geerlingguy.mysql
when:
- lookup('ansible.builtin.env', 'DB_BACKEND') == 'mysql'