diff --git a/.gitignore b/.gitignore index 9e8b6b1..e986cf0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.pyc __pycache__ files/ +.idea diff --git a/defaults/main.yaml b/defaults/main.yaml index 36d8dba..c8bc4a3 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -53,8 +53,8 @@ mariadb: application_event_log: /var/log/application_events/MariaDB-Backup.log repository: apt: - key_url: https://mariadb.org/mariadb_release_signing_key.asc - repository: "deb [arch={{ apt_arch }}] http://mirror.netcologne.de/mariadb/repo/{{ vars.mariadb.version }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }} main" + key_url: https://mirror.netcologne.de/mariadb/PublicKey_v2 + repository: "http://mirror.netcologne.de/mariadb/repo/{{ vars.mariadb.version }}/{{ ansible_distribution | lower }}" mariadb_root_password: >- {%- if mariadb.galera.cluster and not mariadb.galera.initializer -%} {{- (mariadb_galera_cluster_nodes diff --git a/tasks/install.yaml b/tasks/install.yaml index 64acd8a..832e8a2 100644 --- a/tasks/install.yaml +++ b/tasks/install.yaml @@ -4,27 +4,30 @@ - ansible_os_family == 'Debian' - mariadb.repository.apt.repository block: - - name: Install GPG + - name: Install requirements for MariaDB ansible.builtin.apt: update_cache: yes name: - gpg - gpg-agent + - python3-debian - - name: Add MariaDB repository key - ansible.builtin.apt_key: - url: "{{ mariadb.repository.apt.key_url }}" + - name: Remove the legacy MariaDB repository + ansible.builtin.file: + dest: /etc/apt/sources.list.d/mariadb.list + state: absent - name: Add MariaDB repository - loop: - - /etc/apt/sources.list.d/mariadb.list - ansible.builtin.copy: - content: | - {{ mariadb.repository.apt.repository }} - dest: "{{ item }}" - owner: root - mode: "0644" register: mariadb_add_apt_repository + ansible.builtin.deb822_repository: + name: "mariadb" + uris: "{{ mariadb.repository.apt.repository }}" + signed_by: "{{ mariadb.repository.apt.key_url }}" + types: [deb] + components: [main] + suites: '{{ ansible_distribution_release }}' + state: present + enabled: yes - name: Update apt cache ansible.builtin.apt: