-
Notifications
You must be signed in to change notification settings - Fork 32
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
DTT1 - Test module if Ansible execution fails not report to Workflow #5411
Comments
Update reportAnalyzing bug number 1: The problem is because Jinja is being used to render the playbooks, for example:
When rendering the playbook with Jinja, what happens is that it tries to replace the value of item with Jinja, when it has to be an iterable of the loop. So when the playbook reaches ansible, it will render the item variable and it has already been replaced and is empty, which is why it cannot loop ansible. Test:
Now replace the values correctly. |
Update reportAnalyzing bug number 2. During the analysis of this bug, an error was found in the execution of the commands that require sudo. Step to detail: You have to execute this command which installs the manager with the installation wizard:
The execute_commands executes the command via ssh like this:
It incorporates sudo into all the commands that require it, the problem is that by having 2 or more commands nested with the "&&", it will only execute the first command with sudo and the subsequent one not. In fact this bug was found for the mentioned example:
That said, it is necessary to modify all the executions of nested commands to a list of commands, since the executor allows sending a list of commands and executes them one by one, thus incorporating sudo for each command. In the aforementioned example, it would look something like this:
After these changes the tests were satisfactory. Analyzing bug number 2: it was detected that the result of the playbook execution is not being analyzed, it is only analyzed if it fails with an exception and not if the executed playbook(s) fail. |
Update reportAll modifications to fix the bugs were made. Test forcing failure into one playbook: Input yaml:
The test shows the real error and does not continue with the rest of the tests: Full log: |
Update reportFull test: Input yaml:
Result: |
New test without debug: Result: In this test, the failure is observed in the Windows server 2022 and the error is displayed without the need for debugging and informs the Workflow. |
Review NotesLGTM |
LGTM |
Description
The objective of the issue is to solve two bugs:
Tasks
Related
4495-dtt1-release
The text was updated successfully, but these errors were encountered: