--- - hosts: all become: true tasks: - name: Dump database community.mysql.mysql_db: state: dump name: sdis29 target: /tmp/sdis29.sql - name: Copy database dump file fetch: src: /tmp/sdis29.sql dest: /home/debian/sdis29/ansible