redhat-cop / openshift-applier

Used to apply OpenShift objects to an OpenShift Cluster
Apache License 2.0
102 stars 61 forks source link

Fix 3.0.4 issue if requirements not set #174

Closed rossato-rh closed 1 year ago

rossato-rh commented 1 year ago

What does this PR do?

3.0.4 introduced a slight issue that if galaxy isn't used, the tmp_dep_dir variable is never set and so the openshift-applier role always crashes. My fix just skips the affected task, but the surrounding logic looks like it would be ok (unnecessary round trip of the ANSIBLE_ROLES_PATH env variable, but not a big deal).

How should this be tested?

cp -r openshift-applier/roles . # current directory has a valid playbook ansible-playbook -i hosts.yaml playbook.yaml

Is there a relevant Issue open for this?

Didn't open an issue.

Who would you like to review this?

cc: @redhat-cop/openshift-applier @oybed

oybed commented 1 year ago

Thank you for submitting this PR and finding this issue.

The pre/post steps shouldn't really execute unless they are defined in the inventory, and the only way to pull in pre/post steps right now are through a galaxy_requirements and/or galaxy_sources - so from that perspective this issue shouldn't really happen.

Is this a problem perhaps when running in a bit of a modified environment - for example if/when a set of roles are copied into the openshift-applier directory (or otherwise coping the openshift-applier role into another set of roles) as part of executing the playbook? Reading the testing steps, this seems to perhaps be the case.

Just trying to understand how this issue is reproduced.

oybed commented 1 year ago

Closing for now as it appears this was perhaps an environment related issue. Please re-open PR if needed.