Bug 2035907

Summary: Ansible config report time is one hour off
Product: Red Hat Satellite Reporter: Stefan Meyer <smeyer>
Component: Ansible CollectionAssignee: Evgeni Golov <egolov>
Status: CLOSED ERRATA QA Contact: Griffin Sullivan <gsulliva>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.10.1CC: egolov, jrichards2, karnsing, oezr, pcreech, pmoravec, wpinheir
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ansible-collection-redhat-satellite-3.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:31:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stefan Meyer 2021-12-28 12:56:28 UTC
Description of problem:
When running "puppet agent -t" the time of the config report is correctly added as UTC to the database.
When running Ansible roles on systems the reported time is one hour behind UTC-1.

Version-Release number of selected component (if applicable):
- Satellite 6.10.1

How reproducible:
- Everytime
- On an updated Satellite 6.2 all the way to 6.10.1
- On a newly installed Satellite 6.10.1

Steps to Reproduce:
1. Run "puppet agent -t" on the Satellite
2. Note the reported time for the Puppet run with "hammer config-report list --search="host = satellite.example.com"
3. Run all assigned Ansible roles (or none) on the same Satellite
4. Note the time for the Ansible run

Actual results:
- The time for the Ansible run is one hour behind the Puppet run while it was started after the Puppet run
- The Ansible run also has a higher config_report id

Expected results:
- The times for the Ansible run should be added correctly

Additional info:

I started Puppet run at 13:26 CET (#1485399) which was correctly reported at 12:26:01 UTC.
A few minutes later I started an Ansible run (#1485400) which was reported as 11:26:47 UTC
but it is in fact UTC-1.

[root@satellite6:/etc]# hammer config-report list --search="host = satellite.example.com"
--------|-------------------------|---------------------|---------|
ID      | HOST                    | LAST REPORT         | ORIGIN  |
--------|-------------------------|---------------------|---------|
1485399 | satellite.example.com   | 2021/12/28 12:26:01 | Puppet  |
1485395 | satellite.example.com   | 2021/12/28 12:13:16 | Puppet  |
1485391 | satellite.example.com   | 2021/12/28 11:43:16 | Puppet  |
1485400 | satellite.example.com   | 2021/12/28 11:26:47 | Ansible |
1485387 | satellite.example.com   | 2021/12/28 11:13:16 | Puppet  |

Checking https://satellite.example.com/config_reports the times are correctly set to CET but the Ansible
run is still an hour off and reflects the hammer output in UTC.

So, Puppet config runs are always reported correctly and Ansible runs are always one hour off.

Comment 2 Marek Hulan 2022-01-05 14:32:12 UTC
This should be fixed in the upstream, I think Stefan was testing this patch so he can confirm.

Comment 3 Stefan Meyer 2022-01-05 15:02:44 UTC
I can confirm that https://github.com/theforeman/foreman-ansible-modules/pull/1333 fixed it for me.

In case someone likes to use this fix, please be aware that it needs to be changed on Satellite and
ALL Capsules.

Comment 4 Ondřej Ezr 2022-02-03 18:18:43 UTC
*** Bug 2049828 has been marked as a duplicate of this bug. ***

Comment 5 Griffin Sullivan 2022-02-08 20:58:49 UTC
Verified in 7.0 snap 8

Config reports correctly display time in local or UTC time for Ansible reports.

Steps to Reproduce:
1. Run an Ansible role
2. Check Monitor > Config Management
3. # hammer config-report list

Expected Results:
Time is reported correctly for Ansible reports under both locations.

Actual Results:
Time is reported correctly for Ansible reports under both locations.

In step 2 hover over time to see execution time in local (EST for me).
In step 3 time was reported in UTC.

Comment 8 errata-xmlrpc 2022-07-05 14:31:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498