--- - hosts: all become: true tasks: - name: Dump database community.mysql.mysql_db: state: dump name: sdis29 target: /tmp/sdis29-dump.sql login_unix_socket: /run/mysqld/mysqld.sock - name: Copy database dump file ansible.builtin.fetch: src: /tmp/sdis29-dump.sql dest: sdis29-dump.sql flat: yes