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

40 lines
1.1 KiB
YAML

---
- name: APT | Install GPG
ansible.builtin.apt:
name: gpg
- name: COMMAND | Check indempotent
ansible.builtin.command: 'grep -q "{{ mariadb_upstream_version }}" /etc/apt/sources.list.d/mariadb.list'
register: check_idempotent
failed_when: false
changed_when: false
- block:
- 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
when: check_idempotent.rc > 0
- name: SHELL | Remove useless old files
ansible.builtin.shell: 'rm -f /etc/apt/sources.list.d/mariadb.list.old_*'
args:
removes: /etc/apt/sources.list.d/mariadb.list.old_1
tags:
- skip_ansible_lint