Implement MDBF cluster deployment

Add a new CI task to deploy MDBF MariaDB versions in a cluster.
This commit is contained in:
Faustin Lammler 2022-10-14 09:56:51 +02:00
parent 2f661616a2
commit c64038d6d9
No known key found for this signature in database
GPG Key ID: 390A2F27832A5C79
6 changed files with 83 additions and 13 deletions

View File

@ -45,8 +45,6 @@ jobs:
- almalinux-9
- rockylinux-8
# - rockylinux-9
playbook:
- converge.yml
steps:
- uses: actions/checkout@v3
- name: Install requirements
@ -66,4 +64,3 @@ jobs:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}

67
.github/workflows/test_cluster_mdbf.yml vendored Normal file
View File

@ -0,0 +1,67 @@
---
name: Cluster MDBF
on:
push:
paths:
- .github/workflows/test_cluster_mdbf.yml
- requirements.txt
- "files/**"
- "handlers/**"
- "molecule/cluster/**"
- "tasks/**"
- "templates/**"
- "vars/**"
pull_request:
paths:
- .github/workflows/test_cluster_mdbf.yml
- requirements.txt
- "files/**"
- "handlers/**"
- "molecule/cluster/**"
- "tasks/**"
- "templates/**"
- "vars/**"
schedule:
- cron: "30 5 * * 2"
jobs:
molecule-cluster-pkg:
name: Cluster MDBF
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro:
- ubuntu-22.04
- debian-11
- fedora-36
- almalinux-8
- rockylinux-9
mariadb-version:
- "10.6"
- "10.7"
- "10.8"
- "10.9"
- "10.10"
steps:
- uses: actions/checkout@v3
- name: Install requirements
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
# This is necessary on GH Actions to allow running systemd in rootless containers
# see: https://github.com/actions/virtual-environments/issues/3536
# see: https://github.com/ansible-community/molecule/discussions/3155
- name: Start systemd user service
run: |
loginctl enable-linger $(whoami)
sleep 1
- name: Run molecule
run: molecule test -s cluster
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLAYBOOK: mdbf.yml
MARIADB_VERSION: ${{ matrix.mariadb-version }}

View File

@ -27,7 +27,7 @@ on:
jobs:
molecule-distrib-pkg:
name: Default
name: Default deployment
runs-on: ubuntu-latest
strategy:
fail-fast: false
@ -45,8 +45,6 @@ jobs:
- almalinux-9
- rockylinux-8
- rockylinux-9
playbook:
- converge.yml
steps:
- uses: actions/checkout@v3
- name: Install requirements
@ -66,4 +64,3 @@ jobs:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}

View File

@ -23,7 +23,7 @@ on:
- "templates/**"
- "vars/**"
schedule:
- cron: "0 5 * * 2"
- cron: "10 5 * * 2"
jobs:
molecule-mdbf-pkg:
@ -45,8 +45,6 @@ jobs:
- almalinux-9
- rockylinux-8
- rockylinux-9
playbook:
- mdbf.yml
mariadb-version:
- "10.3"
- "10.4"
@ -111,5 +109,5 @@ jobs:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
MOLECULE_PLAYBOOK: mdbf.yml
MARIADB_VERSION: ${{ matrix.mariadb-version }}

11
molecule/cluster/mdbf.yml Normal file
View File

@ -0,0 +1,11 @@
---
- name: Converge
hosts: all
gather_facts: true
vars:
mariadb_use_official_repo: true
mariadb_use_official_repo_url: https://deb.mariadb.org
mariadb_use_official_repo_version: "{{ lookup('env', 'MARIADB_VERSION') }}"
roles:
- role: ansible-role-mariadb

View File

@ -8,9 +8,9 @@
[mariadb]
name = MariaDB
{% if ansible_distribution == "Fedora" %}
baseurl = https://yum.mariadb.org/{{ mariadb_use_official_repo_version }}/fedora{{ ansible_distribution_major_version }}-amd64
baseurl = https://rpm.mariadb.org/{{ mariadb_use_official_repo_version }}/fedora{{ ansible_distribution_major_version }}-amd64
{% else %}
baseurl = https://yum.mariadb.org/{{ mariadb_use_official_repo_version }}/rhel{{ ansible_distribution_major_version }}-amd64
baseurl = https://rpm.mariadb.org/{{ mariadb_use_official_repo_version }}/rhel{{ ansible_distribution_major_version }}-amd64
{% endif %}
gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
module_hotfixes = 1