It might be worth adding an assertion for this to make it easier to debug.

    fail: legacy_ora | check that required variables are defined
    when: ora_app_dir is not defined or ora_app_user is not defined