---
- name: Update MariaDB Dependencies
  shell: >-
    curl -sSL https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
    | bash -s -- --mariadb-server-version="mariadb-10.5"

- name: Install MariaDB
  apt:
    name: "{{ packages }}"
    state: present
    update_cache: true
  vars:
    packages:
      - mariadb-server
      - mariadb-client

- name: Install MariaDB Supervisord conf
  template:
    src: my.cnf.j2
    dest: /etc/mysql/conf.d/db.cnf
    owner: "mariadb"
    force: true
    mode: 0644

- name: Install MariaDB Supervisord conf
  template:
    src: supervisor.conf.j2
    dest: /etc/supervisor/conf.d/mariadb.conf
    force: true
    mode: 0644

- name: Disable MariaDB service
  service:
    name: "mysql"
    enabled: false
    state: stopped
  ignore_errors: true

---
- name: Update MariaDB Dependencies
  shell: >-
    curl -sSL https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
    | bash -s -- --mariadb-server-version="mariadb-10.5"

- name: Install MariaDB
  apt:
    name: "{{ packages }}"
    state: present
    update_cache: true
  vars:
    packages:
      - mariadb-server
      - mariadb-client

- name: Install MariaDB Supervisord conf
  template:
    src: my.cnf.j2
    dest: /etc/mysql/conf.d/db.cnf
    force: true
    mode: 0644

- name: Install MariaDB Supervisord conf
  template:
    src: supervisor.conf.j2
    dest: /etc/supervisor/conf.d/mariadb.conf
    force: true
    mode: 0644

- name: Disable MariaDB service
  service:
    name: "mysql"
    enabled: false
    state: stopped
  ignore_errors: true

Update file owner on Ansible MariaDB.
Update file owner on Ansible MariaDB.
