--- - name: mysql user mysql_user: name: "{{ nextcloud_database_user }}" host: "{{ ssh_ip }}" password: "{{ nextcloud_database_password }}" priv: "{{nextcloud_database_name}}.*:ALL" delegate_to: "{{ nextcloud_database_host }}" - name: mysql database mysql_db: name: "{{nextcloud_database_name}}" encoding: utf8mb4 collation: utf8mb4_unicode_ci state: present delegate_to: "{{ nextcloud_database_host }}"