test: add support debian 11

This commit is contained in:
Adrien Waksberg 2021-08-22 16:33:57 +02:00 committed by Adrien Waksberg
parent 51fbef2480
commit 03dcb51ea1
8 changed files with 38 additions and 14 deletions

View file

@ -11,6 +11,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
## [v2.0.1] - 2020-03-28
### Added
- test: add support debian 11
### Changed
- fix: remove default value for mariadb_password

View file

@ -8,8 +8,10 @@ Install and configure MariaDB
## Requirements
* Ansible >= 2.8
* Debian Stretch and Buster
* Ansible >= 2.9
* Debian
* Buster
* Bullseye
## Role variables
@ -97,7 +99,7 @@ Example:
* install [docker](https://docs.docker.com/engine/installation/)
* install `python3` and `python3-pip`
* install molecule and dependencies `pip3 install molecule 'molecule[docker]' docker ansible-lint testinfra yamllint`
* install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
* run `molecule test`
## License

View file

@ -1,6 +1,6 @@
---
mariadb_use_official_repository: yes
mariadb_branch: 10.3
mariadb_branch: 10.6
mariadb_repository: |
deb http://mariadb.mirrors.ovh.net/MariaDB/repo/{{ mariadb_branch }}/debian {{ ansible_distribution_release }} main
mariadb_repository_key_id: '0xF1656F24C74CD1D8'

View file

@ -5,13 +5,13 @@ galaxy_info:
company: Adrien Waksberg
description: Install and configure mariadb
license: Apache2
min_ansible_version: 2.8
min_ansible_version: 2.9
platforms:
- name: Debian
versions:
- stretch
- buster
- bullseye
galaxy_tags:
- database

View file

@ -1,6 +1,8 @@
---
- name: Converge
hosts: all
roles:
- ansible-role-mariadb
vars:
mariadb_password: secret
mariadb_autorestart: yes
@ -19,5 +21,8 @@
password: test
privileges:
- 'test.*:ALL'
roles:
- ansible-role-mariadb
pre_tasks:
- name: update apt cache
ansible.builtin.apt:
update_cache: true

View file

@ -2,17 +2,22 @@
driver:
name: docker
platforms:
- name: debian10
image: nishiki/debian10:molecule
- name: debian11
image: nishiki/debian11:molecule
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
command: /bin/systemd
capabilities:
- SYS_ADMIN
provisioner:
inventory:
host_vars:
debian11:
mariadb_use_official_repository: yes
lint: |
set -e
yamllint .
ansible-lint
ansible-lint .
verifier:
name: testinfra

View file

@ -2,7 +2,7 @@ import os, re
import testinfra.utils.ansible_runner
def test_packages(host):
for package_name in ['mariadb-server', 'python-mysqldb']:
for package_name in ['mariadb-server', 'python3-mysqldb']:
package = host.package(package_name)
assert package.is_installed

View file

@ -1,4 +1,14 @@
---
- name: install dependencies packages
ansible.builtin.package:
name:
- gpg
- python3-mysqldb
retries: 2
register: result
until: result is succeeded
tags: mariadb
- import_tasks: repo.yml
when: mariadb_use_official_repository|bool
@ -6,8 +16,6 @@
ansible.builtin.package:
name:
- mariadb-server
- python-mysqldb
- python3-mysqldb
retries: 2
register: result
until: result is succeeded