Skip to content

Commit

Permalink
Use new repository-format, remove old .list, update sigining key (#11)
Browse files Browse the repository at this point in the history
* Use new repository-format, remove old .list, update sigining key

* Add debian-python for handling new repository-format
  • Loading branch information
mpeu authored Dec 16, 2024
1 parent 864907e commit 4814dd0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.pyc
__pycache__
files/
.idea
4 changes: 2 additions & 2 deletions defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 15 additions & 12 deletions tasks/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 32 in tasks/install.yaml

View workflow job for this annotation

GitHub Actions / lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 32 in tasks/install.yaml

View workflow job for this annotation

GitHub Actions / lint

no-handler

Tasks that run when changed should likely be handlers.
ansible.builtin.apt:
Expand Down

0 comments on commit 4814dd0

Please sign in to comment.