voxpupuli / puppet-yum

Puppet module for Yum
https://forge.puppet.com/puppet/yum
MIT License
16 stars 101 forks source link

RHEL 8 /etc/yum.conf broken symbolic link #227

Open tjmullicani opened 2 years ago

tjmullicani commented 2 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Any yum::config option will cause the issue.

Example is: yum::config { 'gpgcheck': ensure => 1, }

What are you seeing

Starting in RHEL 8, a new major release of yum, now known as dnf, was released. As part of this change, /etc/yum.conf is no longer directly responsible for configuring the package manager settings. The legacy file /etc/yum.conf is kept as a symbolic link to the new package manager configuration file /etc/dnf/dnf.conf.

When using yum::config, the symlink at /etc/yum.conf is removed and a new regular file is created in its place. This new file will not be read by dnf, since it only looks at /etc/dnf/dnf.conf by default (can override with dnf -c <config file> option).

Before puppet agent -t run: [root@client ~]# ls -l /etc/yum.conf lrwxrwxrwx. 1 root root 17 Nov 2 01:35 /etc/yum.conf -> /etc/dnf/dnf.conf

After puppet agent -t run: [root@client ~]# ls -l /etc/yum.conf -rw-r--r--. 1 root root 99 Nov 2 01:26 /etc/yum.conf

What behaviour did you expect instead

/etc/yum.conf symbolic link should be kept. [root@client ~]# ls -l /etc/yum.conf lrwxrwxrwx. 1 root root 17 Nov 2 01:35 /etc/yum.conf -> /etc/dnf/dnf.conf

The module should either: 1) modify the target of the symbolic link, rather than the symbolic link itself (similar to sed --follow-symlinks) 2) add an option to change the location of the package manager configuration file (e.g., RHEL7 => /etc/yum.conf, RHEL8 => /etc/dnf/dnf.conf) https://github.com/voxpupuli/puppet-yum/blob/099c488912be27d9b1745e010b5a3eace3f6d2de/manifests/config.pp#L39

Output log

Any additional information you'd like to impart

traylenator commented 2 years ago

Hi @tjmullicani

I cannot reproduce this:

[root@home ~]# puppet apply test.pp
Notice: Compiled catalog for lxplus8s16.cern.ch in environment production in 0.05 seconds
Notice: /Stage[main]/Main/Yum::Config[gpgcheck]/Augeas[yum.conf_gpgcheck]/returns: executed successfully
Notice: Applied catalog in 0.58 seconds
[root@lxplus8s16 ~]# ls -l /etc/yum.conf 
lrwxrwxrwx. 1 root root 12 May 27 03:06 /etc/yum.conf -> dnf/dnf.conf
── puppet-yum (v5.4.0)
├── puppetlabs-concat (v7.2.0)
└── puppetlabs-stdlib (v8.2.0)
puppet agent --version
7.12.0