--- - name: "[OpenRC] Disable and stop service: mariadb" service: name: mariadb enabled: no state: stopped when: - ansible_service_mgr == "openrc" - name: "[systemd] Disable and stop service: mariadb" systemd: name: mariadb enabled: no state: stopped when: - ansible_service_mgr == "systemd" - name: "[Alpine] Remove package: mariadb mariadb-common mariadb-client python-pymysql" apk: name: mariadb mariadb-common mariadb-client python-pymysql state: absent when: - ansible_distribution == "Alpine" - name: "[Archlinux] Remove package: mariadb python-pymysql" pacman: name: - mariadb - python-pymysql state: absent when: - ansible_distribution == "Archlinux"