--- - name: "Install dependencies" ansible.builtin.apt: name: - "mariadb-server" - "python3-pymysql" update_cache: true cache_valid_time: 86400 - name: "Create database" ansible.builtin.mysql_db: login_unix_socket: "/var/run/mysqld/mysqld.sock" name: "{{ db_name }}" - name: "Create user" ansible.builtin.mysql_user: login_unix_socket: "/var/run/mysqld/mysqld.sock" name: "{{ db_user }}" password: "{{ db_password }}" priv: "{{ db_name }}.*:ALL"