1. Proposed title of this feature request
Ability to generate a report for ansible/remote execution task result.
2. Who is the customer behind the request?
Added in private note.
3. What is the nature and description of the request?
IHAC looking for a feature to generate/download a report of ansible/remote execution result after the completion of remote execution job.
4. Why does the customer need this? (List the business requirements here)
Customer is running few commands on a list of servers after the completion of remote job.
5. How would the customer like to achieve this? (List the functional requirements here)
Customer want to generate a Excel report from the result.
6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
7. Is there already an existing RFE upstream or in Red Hat Bugzilla?
8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?
9. Is the sales team involved in this request and do they have any additional input?
10. List any affected packages or components.
11. Would the customer be able to assist in testing this functionality if implemented?
Could you please share more information about what columns the report should contain or how it should be structured? Is on record representing a job or a host? Do they want to have STDOUT/STDERR for a particular host included in the report? Do they want to mix REX and Ansible runs in the same report or should it be optional or even two separate reports? I guess that's clear, but it would be based on our DB, meaning once data gets automatically cleaned, they wouldn't be part of the report.
Could you please share more information about what columns the report should contain or how it should be structured?
- we dont have a specific requirement. we can have it as JOB ID, DATE/TIME, HOST, RESULT (STDOUT)
Is on record representing a job or a host?
- Its representing a job.
Do they want to have STDOUT/STDERR for a particular host included in the report?
- Customer is expecting the Result of command output. If we have a option to include STDERR it will be great.
Do they want to mix REX and Ansible runs in the same report or should it be optional or even two separate reports?
- Customer is expecting the report based on the job so we can have a two different reports.
*** Bug 1757739 has been marked as a duplicate of this bug. ***
Thanks for answers. If the report is per job, why do you want to include job ID in it? That will be the same ID for every line in csv right? But that is a small detail we can figure out later. I think it's now clear enough for us to get started.
Upstream bug assigned to email@example.com
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/15265 has been resolved.
Added link to redmine issue where I solved the problem described by Lukáš.
FailedQA for multiple reasons. Tried with Sat 6.10.0 snap 21.0.
1) Attempting to render with some nonexistent job_id results in file only containing headers. No warning.
2) Attempting to render a running job results in "undefined method `in_time_zone' for nil:NilClass"
3) The template is named "Jobs - Invocation report template", inconsistently with the others.
4) stderr is in "stdout" column together with stdout, "stderr" column is empty:
Have this executable file on the host in /root/runthis.py:
On the host, run the following SSH job:
Generate a report and see everything in the stdout column
Note: can't test with Ansible due to bug 2010863.
I'm under the impressions these were not introduced with the new version right? Considering we're now accepting only blocker fixes, is some of the findings blocker in your opinion?
1) not a blocker, should be tracked as a separate bug
2) seems like an edge case, but could be simple to solve
3) imho not a blocker, also not sure what inconsistency you mean, perhaps singular vs plural of the first word? Or the word template? Probably trivial to change
4) I believe this is unrelated bug that was found in REX some time ago, we no longer are able to distinguish between stdout and stderr, I think Adam has more info on this one, perhaps there's already a BZ tracking it
> 4) I believe this is unrelated bug that was found in REX some time ago, we no longer are able to distinguish between stdout and stderr, I think Adam has more info on this one, perhaps there's already a BZ tracking it
The script currently runs in a PTY on the remote side. PTYs provide only one input stream and one output stream, meaning we lose the distinction between stdout and stderr. This is nothing new, this behavior has been there for ages. There are some bits and pieces which can still end up in what Satellite thinks is stderr, but those will be about things that happen before the script is actually started on the other side. Afaik there's no BZ for this yet, but it will most likely go away once we move away from net/ssh
Re comment 19, if we can't distinguish stdout from stderr, that's fine but the report shouldn't contain the stderr column in that case. Except maybe if we plan to fix it and it's for forward compatibility but it should be documented that it doesn't actually contain stderr yet and stdout does.