ansible-mysql/tasks/install/mariadb/upstream.yml

33 lines
941 B
YAML
Raw Permalink Normal View History

---
- name: APT | Install GPG
ansible.builtin.apt:
name: gpg
2024-08-26 15:12:09 +07:00
- name: COMMAND | Check expected mariadb version
ansible.builtin.command: 'grep -q "{{ mariadb_upstream_version }}" /etc/apt/sources.list.d/mariadb.list'
2024-08-26 15:12:09 +07:00
register: check_version
failed_when: false
changed_when: false
2024-08-26 15:12:09 +07:00
- name: APT | Add MariaDB upstream repository
when: check_version.rc > 0
block:
2017-07-03 20:24:01 +07:00
- name: GET_URL | Download MariaDB setup script
ansible.builtin.get_url:
url: '{{ mariadb_upstream_setup_script }}'
dest: '/tmp/mariadb_repo_setup'
mode: 0755
owner: root
group: root
- name: COMMAND | Launch MariaDB upstream setup script
ansible.builtin.command: '/tmp/mariadb_repo_setup --mariadb-server-version={{ mariadb_upstream_version }}'
changed_when: true
- name: FILE | Remove setup script
ansible.builtin.file:
path: '/tmp/mariadb_repo_setup'
state: absent