Skip to content

Commit

Permalink
🐛 Fix MariaDB apt-key is deprecated failure (#1515)
Browse files Browse the repository at this point in the history
* 🐛 Fix MariaDB apt-key is deprecated failure

* Use apt_repository

* Use apt_key module

---------

Co-authored-by: Scott Walkinshaw <scott.walkinshaw@gmail.com>
  • Loading branch information
retlehs and swalkinshaw authored Apr 23, 2024
1 parent d0c75a9 commit 801a825
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 0 additions & 2 deletions roles/mariadb/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
mariadb_version: 10.6
mariadb_keyserver: "hkp://keyserver.ubuntu.com:80"
mariadb_keyserver_id: "0xF1656F24C74CD1D8"
mariadb_ppa: "deb https://mirror.rackspace.com/mariadb/repo/{{ mariadb_version }}/ubuntu {{ ansible_distribution_release }} main"

mariadb_client_package: mariadb-client
Expand Down
23 changes: 11 additions & 12 deletions roles/mariadb/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
---
- block:
- name: Add MariaDB APT key
apt_key:
keyserver: "{{ mariadb_keyserver }}"
id: "{{ mariadb_keyserver_id }}"
- name: Add an Apt signing key, uses whichever key is at the URL
ansible.builtin.apt_key:
url: "https://mariadb.org/mariadb_release_signing_key.asc"
state: present

- name: Add MariaDB PPA
apt_repository:
repo: "{{ mariadb_ppa }}"
update_cache: yes
- name: Add MariaDB PPA
apt_repository:
repo: "{{ mariadb_ppa }}"
update_cache: yes

- name: Install MySQL client
apt:
ansible.builtin.apt:
name: "{{ mariadb_client_package }}"
state: "{{ mariadb_client_package_state | default(apt_package_state) }}"
cache_valid_time: "{{ apt_cache_valid_time }}"
update_cache: true

- block:
- name: Install MySQL server
apt:
ansible.builtin.apt:
name: "{{ mariadb_server_package }}"
state: "{{ mariadb_server_package_state | default(apt_package_state) }}"
cache_valid_time: "{{ apt_cache_valid_time }}"
Expand Down

0 comments on commit 801a825

Please sign in to comment.