Bug 2253215

Summary: puppet-agent rpm package does not classify important configuration files properly
Product: Red Hat Satellite Reporter: Joniel Pasqualetto <jpasqual>
Component: InstallationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED MIGRATED QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.13.6CC: ehelms, rlavi
Target Milestone: UnspecifiedKeywords: MigratedToJIRA, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-06 16:37:43 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 Joniel Pasqualetto 2023-12-06 14:25:23 UTC
Description of problem:

Our puppet-agent package marks the following files a config:

~~~
# rpm -qc puppet-agent-7.26.0-3.el8sat.x86_64
/etc/logrotate.d/pxp-agent
/etc/puppetlabs/code/environments/production/environment.conf
/etc/puppetlabs/puppet/hiera.yaml
/etc/puppetlabs/puppet/puppet.conf
/etc/sysconfig/puppet
/etc/sysconfig/pxp-agent
/opt/puppetlabs/puppet/share/vim/puppet-vimfiles/ftdetect/puppet.vim
/opt/puppetlabs/puppet/share/vim/puppet-vimfiles/ftplugin/puppet.vim
/opt/puppetlabs/puppet/share/vim/puppet-vimfiles/indent/puppet.vim
/opt/puppetlabs/puppet/share/vim/puppet-vimfiles/syntax/puppet.vim
/usr/lib64/tmpfiles.d/puppet-agent.conf
~~~

However, we do not define /etc/puppetlabs/code/environments/production/hiera.yaml as %config

As consequence, /etc/puppetlabs/code/environments/production/hiera.yaml is overwritten during package upgrades and results in any customization being lost when puppet-agent is updated. 

If the puppet-agent package is being used on a client server, that should not be a problem.However, when the package is installed on a puppetserver (a satellite or capsule) this can become a problem. 

If we look at the package distributed by puppetlabs, this file is properly marked as config and is not overwritten by updates:

~~~
# rpm -qpc puppet-agent-7.13.1-1.el8.x86_64.rpm 
warning: puppet-agent-7.13.1-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 9e61ef26: NOKEY
/etc/logrotate.d/pxp-agent
/etc/puppetlabs/code/environments/production/environment.conf
/etc/puppetlabs/code/environments/production/hiera.yaml
/etc/puppetlabs/puppet/hiera.yaml
/etc/puppetlabs/puppet/puppet.conf
/etc/sysconfig/puppet
/etc/sysconfig/pxp-agent
/opt/puppetlabs/puppet/share/vim/puppet-vimfiles/ftdetect/puppet.vim
/opt/puppetlabs/puppet/share/vim/puppet-vimfiles/ftplugin/puppet.vim
/opt/puppetlabs/puppet/share/vim/puppet-vimfiles/indent/puppet.vim
/opt/puppetlabs/puppet/share/vim/puppet-vimfiles/syntax/puppet.vim
/usr/lib/tmpfiles.d/puppet-agent.conf
~~~


How reproducible: always


Steps to Reproduce:
1. make any changes on /etc/puppetlabs/code/environments/production/hiera.yaml
2. update puppet-agent package 
3. check the file /etc/puppetlabs/code/environments/production/hiera.yaml again and observe that the changes made on step 1 are gone


Actual results:
/etc/puppetlabs/code/environments/production/hiera.yaml is always reset to defaults after puppet-agent is updated

Expected results:
changes made on /etc/puppetlabs/code/environments/production/hiera.yaml would remain in place after upgrades of puppet-agent

Additional info:

Comment 2 Eric Helms 2024-06-06 16:37:43 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.