Bug 1967335 - metrics role task to enable logging for targeted hosts not working
Summary: metrics role task to enable logging for targeted hosts not working
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rhel-system-roles
Version: 8.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: beta
: 8.5
Assignee: Rich Megginson
QA Contact: Jan Kurik
Eliane Ramos Pereira
Whiteboard: role:metrics
Depends On:
Blocks: 1978746
TreeView+ depends on / blocked
Reported: 2021-06-02 22:16 UTC by Brian Smith
Modified: 2021-11-09 20:35 UTC (History)
5 users (show)

Fixed In Version: rhel-system-roles-1.4.0-1.el8
Doc Type: Bug Fix
Doc Text:
.Task to enable logging for targeted hosts in the `metric` role now works Previously, a bug in the `metric` RHEL System Role prevented referring to targeted hosts in the `enabling the performance metric logging` task. Consequently, the control file for performance metric logging was not generated. This update fixes the issue, and now the targeted hosts are correctly referred to. As a result, the control file is successfully created, enabling the performance metric logging execution.
Clone Of:
: 1978746 (view as bug list)
Last Closed: 2021-11-09 17:45:29 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github linux-system-roles metrics pull 87 0 None closed __pcp_target_hosts not defined so loop doesn't run 2021-06-10 17:09:06 UTC
Red Hat Product Errata RHBA-2021:4159 0 None None None 2021-11-09 17:45:47 UTC

Description Brian Smith 2021-06-02 22:16:33 UTC
Description of problem:
The "Ensure performance metric logging is enabled for targeted hosts" task is not doing anything, even if the "metrics_monitored_hosts" role variable is defined.  This prevents pmlogger from gathering metrics from remote hosts

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

How reproducible:
Every time

Steps to Reproduce:
1. Run playbook:
- hosts: localhost
    metrics_graph_service: yes
    metrics_query_service: yes
    metrics_retention_days: 7
    metrics_monitored_hosts: ["rhel8-server1", "rhel8-server2", "rhel7-server1", "rhel7-server2"]
    - redhat.rhel_system_roles.metrics

Actual results:
The "Ensure performance metric logging is enabled for targeted hosts" task doesn't do anything:

TASK [redhat.rhel_system_roles.private_metrics_subrole_pcp : Ensure performance metric logging is enabled for targeted hosts] ***

Expected results:
The task runs and creates configuration files for each host under 

Additional info:

It appears to me that the issue is the "Ensure performance metric logging is enabled for targeted hosts" task is looping on the "__pcp_target_hosts" variable which is not set anywhere, so the loop doesn't run.    

I updated the task to loop on "pcp_target_hosts" and this appeared to fix the issue and the task runs as expected and created the configuration files.

Comment 1 Brian Smith 2021-06-02 22:22:53 UTC
Created pull request with proposed fix (please verify this is correct way to fix issue):  https://github.com/linux-system-roles/metrics/pull/87

Comment 15 errata-xmlrpc 2021-11-09 17:45:29 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 (rhel-system-roles bug fix and enhancement update), and where to find the updated
files, follow the link below.

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


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