- name: install apt: name: - mariadb-server - libmysqlclient-dev state: present update_cache: yes - name: install python client pip: name: mysqlclient state: present - name: ensure service is start service: name: mysql state: started enabled: yes - name: change root password mysql_user: name: root password: '{{ db_root_password }}' host: 'localhost' - name: write root credentials template: src: my.cnf.j2 dest: /root/.my.cnf mode: '0600'