--- - name: "[Alpine] Install package: mariadb mariadb-common mariadb-client python-pymysql" apk: name: mariadb mariadb-common mariadb-client python-pymysql state: present when: - ansible_distribution == "Alpine" - name: "[Archlinux] Install package: mariadb python-pymysql" pacman: name: - mariadb - python-pymysql state: present when: - ansible_distribution == "Archlinux" - name: "[Archlinux] Create database structure at: /var/lib/mysql" command: cmd: "mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql" creates: /var/lib/mysql/mysql when: - ansible_distribution == "Archlinux"