49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
---
|
|
- name: mariadb | stop mariadb service before upgrade
|
|
service:
|
|
name: mariadb
|
|
state: stopped
|
|
ignore_errors: true
|
|
|
|
- name: mariadb | remove existing repository file (force upgrade)
|
|
file:
|
|
path: /etc/apt/sources.list.d/mariadb.list
|
|
state: absent
|
|
|
|
- name: mariadb | download and run mariadb repository setup script (force upgrade)
|
|
shell: |
|
|
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | bash -s -- --skip-maxscale --mariadb-server-version=mariadb-{{ mariadb_major_version }}.rolling
|
|
become: true
|
|
|
|
- name: mariadb | update apt cache after repository change
|
|
ansible.builtin.apt:
|
|
update_cache: yes
|
|
|
|
- name: mariadb | upgrade mariadb server and client (latest minor version)
|
|
ansible.builtin.apt:
|
|
name:
|
|
- mariadb-server
|
|
- mariadb-client
|
|
state: latest
|
|
notify:
|
|
- restart mariadb
|
|
when:
|
|
mariadb_minor_version is not defined
|
|
|
|
- name: mariadb | upgrade mariadb server and client (specific minor version)
|
|
ansible.builtin.apt:
|
|
name:
|
|
- "mariadb-server=1:{{ mariadb_major_version }}.{{ mariadb_minor_version }}*"
|
|
- "mariadb-client=1:{{ mariadb_major_version }}.{{ mariadb_minor_version }}*"
|
|
state: latest
|
|
force: yes
|
|
notify:
|
|
- restart mariadb
|
|
when:
|
|
- mariadb_minor_version is defined
|
|
|
|
- name: mariadb | run mysql_upgrade after version change
|
|
shell: mysql_upgrade
|
|
ignore_errors: true
|
|
notify:
|
|
- restart mariadb |