it reliably (almost 100% of the occassions I’d say) fails to create the directory ‘data’ on the 1st run of the playbook.
Also with 100% reliabilty it succeeds with this on a 2nd run
a missing backup dir does not cause an error directly following playbook TASKS, bust still it seems to me it gets created on the first round most of the times.
The output you posted - with items “/opt/db/backup/mysql” and “/opt/db/data/mysql” - is not from the task you posted previously. That task had items “backup” and “data”.
Either you’ve inadvertently confused which steps are doing what, or you’ve left out relevant details in a kind but unsuccessful attempt to minimize your post for our benefit. If the latter, please, more detail is always better than more posts asking for additional detail.
It appears to me you’ve left out something, possibly relevant, between creation of /opt/db/{backup,data} and /opt/db/{backup,data}/mysql.