Skip to content

Commit 4814dd0

Browse files
authored
Use new repository-format, remove old .list, update sigining key (#11)
* Use new repository-format, remove old .list, update sigining key * Add debian-python for handling new repository-format
1 parent 864907e commit 4814dd0

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.pyc
33
__pycache__
44
files/
5+
.idea

defaults/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ mariadb:
5353
application_event_log: /var/log/application_events/MariaDB-Backup.log
5454
repository:
5555
apt:
56-
key_url: https://mariadb.org/mariadb_release_signing_key.asc
57-
repository: "deb [arch={{ apt_arch }}] http://mirror.netcologne.de/mariadb/repo/{{ vars.mariadb.version }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }} main"
56+
key_url: https://mirror.netcologne.de/mariadb/PublicKey_v2
57+
repository: "http://mirror.netcologne.de/mariadb/repo/{{ vars.mariadb.version }}/{{ ansible_distribution | lower }}"
5858
mariadb_root_password: >-
5959
{%- if mariadb.galera.cluster and not mariadb.galera.initializer -%}
6060
{{- (mariadb_galera_cluster_nodes

tasks/install.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,30 @@
44
- ansible_os_family == 'Debian'
55
- mariadb.repository.apt.repository
66
block:
7-
- name: Install GPG
7+
- name: Install requirements for MariaDB
88
ansible.builtin.apt:
99
update_cache: yes
1010
name:
1111
- gpg
1212
- gpg-agent
13+
- python3-debian
1314

14-
- name: Add MariaDB repository key
15-
ansible.builtin.apt_key:
16-
url: "{{ mariadb.repository.apt.key_url }}"
15+
- name: Remove the legacy MariaDB repository
16+
ansible.builtin.file:
17+
dest: /etc/apt/sources.list.d/mariadb.list
18+
state: absent
1719

1820
- name: Add MariaDB repository
19-
loop:
20-
- /etc/apt/sources.list.d/mariadb.list
21-
ansible.builtin.copy:
22-
content: |
23-
{{ mariadb.repository.apt.repository }}
24-
dest: "{{ item }}"
25-
owner: root
26-
mode: "0644"
2721
register: mariadb_add_apt_repository
22+
ansible.builtin.deb822_repository:
23+
name: "mariadb"
24+
uris: "{{ mariadb.repository.apt.repository }}"
25+
signed_by: "{{ mariadb.repository.apt.key_url }}"
26+
types: [deb]
27+
components: [main]
28+
suites: '{{ ansible_distribution_release }}'
29+
state: present
30+
enabled: yes
2831

2932
- name: Update apt cache
3033
ansible.builtin.apt:

0 commit comments

Comments
 (0)