Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tjmullicani opened this issue Nov 2, 2021 · 1 comment
Open

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

tjmullicani opened this issue Nov 2, 2021 · 1 comment

Comments

@tjmullicani
Copy link

tjmullicani commented Nov 2, 2021

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: server: 2019.8.8.0-2bionic, client: puppet-agent-6.24.0-1.el8
  • Ruby: server: 2.5.1, client: 2.5.5-106
  • Distribution: server: Ubuntu 18.04, client: RHEL 8.4
  • Module version: 5.3.0

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)
    incl => '/etc/yum.conf',

Output log

Any additional information you'd like to impart

@traylenator
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants