Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check_mode for Tomcat Version Check #96

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

agimenez
Copy link
Contributor

Description of the Change

When running the Ansible in check mode, the task "Download & Extract
Tomcat" fails because the tomcat_check variable is not defined.

The cause is that when Ansible runs in check mode, tasks with the
'command' module are not executed. The Tomcat Version check task
executes a java command that registers the tomcat_check variable,
which is used in the next task ("Download & Extract Tomcat").

As the command is not executed, the variable does not exist and the
conditional test fails.

Forcing the execution of the command, even in check mode, makes the
variable to be defined and the checks to be successful.

Benefits

Role does not fail in Ansible check mode

Possible Drawbacks

Other tasks may have the same problem (I haven't checked).

Applicable Issues

N/A

When running the Ansible in check mode, the task "Download & Extract
Tomcat" fails because the `tomcat_check` variable is not defined.

The cause is that when Ansible runs in check mode, tasks with the
'command' module are not executed. The Tomcat Version check task
executes a java command that registers the `tomcat_check` variable,
which is used in the next task ("Download & Extract Tomcat").

As the command is not executed, the variable does not exist and the
conditional test fails.

Forcing the execution of the command, even in check mode, makes the
variable to be defined and the checks to be successful.
@xtianae7 xtianae7 changed the base branch from master to develop March 16, 2021 12:10
@agimenez
Copy link
Contributor Author

Hey, I can see that a check has failed. Not sure if it has something to do with these changes?

@xtianae7
Copy link
Member

Hey, I can see that a check has failed. Not sure if it has something to do with these changes?

re-running the job that failed, fixed the check :) LGTM

@vicsufer vicsufer merged commit 9796b34 into idealista:develop Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants