Bug 2058777

Summary: Metrics role, with "metrics_from_mssql" option does not configure /var/lib/pcp/pmdas/mssql/mssql.conf on first run
Product: Red Hat Enterprise Linux 9 Reporter: Rich Megginson <rmeggins>
Component: rhel-system-rolesAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED ERRATA QA Contact: Jakub Haruda <jharuda>
Severity: unspecified Docs Contact: Eliane Ramos Pereira <elpereir>
Priority: unspecified    
Version: 9.0CC: briasmit, elpereir, jharuda, nathans, nhosoi, pvlasin, rhel-cs-system-management-subsystem-qe, rmeggins, spetrosi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:metrics
Fixed In Version: rhel-system-roles-1.15.1-1.el9 Doc Type: Bug Fix
Doc Text:
.Configuration by the Metrics role now follows symbolic links correctly When the `mssql pcp` package is installed, the `mssql.conf` file is located in `/etc/pcp/mssql/` and is targeted by the symbolic link `/var/lib/pcp/pmdas/mssql/mssql.conf`. Previously, however, the Metrics role overwrote the symbolic link instead of following it and configuring `mssql.conf`. Consequently, running the Metrics role changed the symbolic link to a regular file and the configuration therefore only affected the `/var/lib/pcp/pmdas/mssql/mssql.conf` file. This resulted in a failed symbolic link, and the main configuration file `/etc/pcp/mssql/mssql.conf` was not affected by the configuration. The issue is now fixed and the `follow: yes` option to follow the symbolic link has been added to the Metrics role. As a result, the Metrics role preserves the symbolic links and correctly configures the main configuration file.
Story Points: ---
Clone Of: 2058655
: 2060523 2060783 (view as bug list) Environment:
Last Closed: 2022-05-17 13:03:41 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:
Bug Depends On: 2058655    
Bug Blocks: 2060523, 2060783    

Description Rich Megginson 2022-02-25 20:40:30 UTC
+++ This bug was initially created as a clone of Bug #2058655 +++

Description of problem:
The metrics role, when used with the  "metrics_from_mssql" option does not configure /var/lib/pcp/pmdas/mssql/mssql.conf on the first playbook run.  This file still appears to have its default settings after the first playbook/role run.  If I run the playbook/role again, the file is properly updated on the second run. 

Version-Release number of selected component (if applicable):
rhel-system-roles-1.7.3-2.el8.noarch

How reproducible:
Every time


Steps to Reproduce:
1.  Run metrics role with the "metrics_from_mssql" option
2.  Check the  /var/lib/pcp/pmdas/mssql/mssql.conf on the hosts

Actual results:
/var/lib/pcp/pmdas/mssql/mssql.conf was not configured on the hosts, even though the "Ensure PCP SQL Server agent is configured" task ran.  If the playbook/role is run again, the task runs again, and the mssql.conf file is updated as expected.

Expected results:
The /var/lib/pcp/pmdas/mssql/mssql.conf should be updated on the first run of the role

Additional info:
After the first run, /var/lib/pcp/pmdas/mssql/mssql.conf is a symlink:

[root@rhel8-server2 ~]# ls -al /var/lib/pcp/pmdas/mssql/mssql.conf
lrwxrwxrwx. 1 root root 39 Jan  7 14:40 /var/lib/pcp/pmdas/mssql/mssql.conf -> ../../../../../etc/pcp/mssql/mssql.conf
 
After the second run, /var/lib/pcp/pmdas/mssql/mssql.conf is a file:

[ansible@rhel8-server2 ~]$ ls -al /var/lib/pcp/pmdas/mssql/mssql.conf 
-rw-------. 1 root root 370 Jan  7 15:02 /var/lib/pcp/pmdas/mssql/mssql.conf

Comment 11 errata-xmlrpc 2022-05-17 13:03:41 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 (new packages: rhel-system-roles), 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/RHBA-2022:2443