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):
Steps to Reproduce:
1. Run playbook:
- hosts: localhost
metrics_monitored_hosts: ["rhel8-server1", "rhel8-server2", "rhel7-server1", "rhel7-server2"]
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] ***
The task runs and creates configuration files for each host under
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.
Created pull request with proposed fix (please verify this is correct way to fix issue): https://github.com/linux-system-roles/metrics/pull/87
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.