From 0766f242f27c901a6fd6c9908e0139056746a755 Mon Sep 17 00:00:00 2001 From: jo Date: Mon, 17 Oct 2022 12:23:30 +0200 Subject: [PATCH] Add deb822 sources for mariadb repository See: - https://repolib.readthedocs.io/en/latest/deb822-format.html - https://wiki.debian.org/DebianRepository/UseThirdParty --- README.md | 1 + defaults/main.yml | 2 ++ tasks/setup_debian.yml | 17 +++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 5f2eeef..667c7f1 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ Available variables are listed below, along with default values (see mariadb_use_official_repo: false mariadb_use_official_repo_url: https://deb.mariadb.org mariadb_use_official_repo_version: "10.10" +mariadb_use_official_repo_format_deb822: false ``` You may deploy the MariaDB Server version that comes with your distribution diff --git a/defaults/main.yml b/defaults/main.yml index c29f60a..085ef11 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,6 +7,8 @@ ansible_python_interpreter: /usr/bin/python3 mariadb_use_official_repo: false mariadb_use_official_repo_url: https://deb.mariadb.org mariadb_use_official_repo_version: 10.6 +# see: https://manpages.debian.org/stable/apt/sources.list.5.en.html#DEB822-STYLE_FORMAT +mariadb_use_official_repo_format_deb822: false mariadb_enabled_on_startup: true # The following is set to true by default but you may consider setting it to diff --git a/tasks/setup_debian.yml b/tasks/setup_debian.yml index 7236406..c0b76c7 100644 --- a/tasks/setup_debian.yml +++ b/tasks/setup_debian.yml @@ -52,6 +52,23 @@ owner: root group: root mode: "0644" + when: not mariadb_use_official_repo_format_deb822 + + - name: Setup mariadb repository sources entry + ansible.builtin.copy: + dest: /etc/apt/sources.list.d/mariadb.sources + content: | + # Ansible managed + X-Repolib-Name: MariaDB + Types: deb + URIs: {{ mariadb_use_official_repo_url }}/{{ mariadb_use_official_repo_version }}/{{ ansible_distribution | lower() }} + Suites: {{ repo_distribution_release }} + Components: main + Signed-By: /etc/apt/keyrings/mariadb-keyring.gpg + owner: root + group: root + mode: "0644" + when: mariadb_use_official_repo_format_deb822 - name: Prefer MariaDB repo over Debian repo ansible.builtin.copy: