2015-07-12 16:50:23 +07:00
|
|
|
---
|
|
|
|
|
2021-09-02 23:17:54 +07:00
|
|
|
- name: APT | Install GPG
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name: gpg
|
|
|
|
|
2022-02-28 16:11:30 +07:00
|
|
|
- name: COMMAND | Check indempotent
|
2022-02-28 17:34:39 +07:00
|
|
|
ansible.builtin.command: 'grep -q "{{ mariadb_upstream_version }}" /etc/apt/sources.list.d/mariadb.list'
|
2022-02-28 16:11:30 +07:00
|
|
|
register: check_idempotent
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
2015-07-12 16:50:23 +07:00
|
|
|
|
2022-02-28 16:11:30 +07:00
|
|
|
- block:
|
2017-07-03 20:24:01 +07:00
|
|
|
|
2022-02-28 16:11:30 +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
|
2015-07-12 16:50:23 +07:00
|
|
|
|
2022-02-28 16:11:30 +07:00
|
|
|
- name: COMMAND | Launch MariaDB upstream setup script
|
|
|
|
ansible.builtin.command: '/tmp/mariadb_repo_setup --mariadb-server-version={{ mariadb_upstream_version }}'
|
2022-02-28 16:59:46 +07:00
|
|
|
changed_when: true
|
|
|
|
|
|
|
|
- name: FILE | Remove setup script
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: '/tmp/mariadb_repo_setup'
|
|
|
|
state: absent
|
2022-02-28 16:11:30 +07:00
|
|
|
|
|
|
|
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
|