--- - name: mariadb | install prerequisite packages ansible.builtin.apt: name: - curl - ca-certificates state: present update_cache: yes - name: mariadb | download and run mariadb repository setup script shell: | curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | bash -s -- --skip-maxscale --mariadb-server-version=mariadb-{{ mariadb_major_version }}.rolling args: creates: /etc/apt/sources.list.d/mariadb.list become: true - name: mariadb | update apt cache after adding repository ansible.builtin.apt: update_cache: yes - name: mariadb | install mariadb server and client (latest minor version) ansible.builtin.apt: name: - mariadb-server - mariadb-client state: present notify: - restart mariadb when: - mariadb_minor_version is not defined - name: mariadb | install mariadb server and client (specific minor version) apt: name: - "mariadb-server=1:{{ mariadb_major_version }}.{{ mariadb_minor_version }}*" - "mariadb-client=1:{{ mariadb_major_version }}.{{ mariadb_minor_version }}*" state: present notify: - restart mariadb when: - mariadb_minor_version is defined - name: mariadb | ensure mariadb service is started and enabled service: name: mariadb state: started enabled: true