Bug 2035907 - Ansible config report time is one hour off
Summary: Ansible config report time is one hour off
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible Collection
Version: 6.10.1
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: 6.11.0
Assignee: Evgeni Golov
QA Contact: Griffin Sullivan
URL:
Whiteboard:
: 2049828 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-28 12:56 UTC by Stefan Meyer
Modified: 2022-07-28 00:38 UTC (History)
7 users (show)

Fixed In Version: ansible-collection-redhat-satellite-3.1.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:31:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman-ansible-modules pull 1333 0 None Merged Specify the timezone in timestamps 2022-01-05 14:32:11 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:31:42 UTC

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


Note You need to log in before you can comment on or make changes to this bug.