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

Use dnf or yum augeas path for main configuration #307

Merged
merged 2 commits into from May 15, 2023

Conversation

traylenator
Copy link

@traylenator traylenator commented May 15, 2023

Pull Request (PR) description

Currently the augeas path for main configuration is at /files/etc/yum.conf/main.

Use a dnf or yum based path based on the package_provider fact.

On Fedora 36 and newer that hard coded augeas path does not exist:

[steve@fedora ~]$ augtool -e 'print /files/etc/yum.conf/main'
augtool> print /files/etc/yum.conf/main

only the new updated dnf based path exists.

augtool> print /files/etc/dnf/dnf.conf
/files/etc/dnf/dnf.conf
/files/etc/dnf/dnf.conf/#comment = "see `man dnf.conf` for defaults and possible options"
/files/etc/dnf/dnf.conf/main
/files/etc/dnf/dnf.conf/main/gpgcheck = "True"
/files/etc/dnf/dnf.conf/main/installonly_limit = "3"
/files/etc/dnf/dnf.conf/main/clean_requirements_on_remove = "True"
/files/etc/dnf/dnf.conf/main/best = "False"
/files/etc/dnf/dnf.conf/main/skip_if_unavailable = "True"

Note on EL8 and EL9 both paths /files/etc/yum.conf and /files/etc/dnf.conf are valid and equal.

Consequently on puppet runs yum::init sets the installonly_limit to 3 in the wrong non-existing file.

To solve this create a new file yum::settings that can have values set from hiera for the yum::config type. The more obvious use of setting this in init.pp is not possible since including this in yum::config would be a huge change for the module.

Note that when the install_limit is changed to 3 the following command is called

/usr/bin/package-cleanup --oldkernels --count=3 -y

and this is bug #295 . This patch hides that problem in acceptance tests again.

Currently the augeas path for main configuration is at
`/files/etc/yum.conf/main`.

On Fedora 36 and newer the hard coded augeas path does not exist:

```
[steve@fedora ~]$ augtool -e 'print /files/etc/yum.conf/main'
augtool> print /files/etc/yum.conf/main
```

only the new updated dnf based path exists.

```
augtool> print /files/etc/dnf/dnf.conf
/files/etc/dnf/dnf.conf
/files/etc/dnf/dnf.conf/#comment = "see `man dnf.conf` for defaults and possible options"
/files/etc/dnf/dnf.conf/main
/files/etc/dnf/dnf.conf/main/gpgcheck = "True"
/files/etc/dnf/dnf.conf/main/installonly_limit = "3"
/files/etc/dnf/dnf.conf/main/clean_requirements_on_remove = "True"
/files/etc/dnf/dnf.conf/main/best = "False"
/files/etc/dnf/dnf.conf/main/skip_if_unavailable = "True"
```

Note on EL8 and EL9 both paths `/files/etc/yum.conf` and
`/files/etc/dnf.conf`  are valid and equal.

Consequently on puppet runs `yum::init` sets the `installonly_limit`
to 3 in the wrong non-existing file.

To solve this create a new file yum::settings that can have values
set from hiera for the `yum::config` type. The more obvious use of setting this in
`init.pp` is not possible since including this in `yum::config` would be
a huge change for the module.

Note that when the install_limit is changed to 3 the following command
is called

`/usr/bin/package-cleanup --oldkernels --count=3 -y`

which is invalid on at least EL9 and Fedora 36 and that should be
independently fixed.
@bastelfreak bastelfreak added the bug Something isn't working label May 15, 2023
Switch to checking versionlock in dnf location on EL8 and newer.

EL8 is:

```
drwxr-xr-x. 3 root root 148 Apr 27 16:43 /etc/dnf/plugins
lrwxrwxrwx. 1 root root  14 Oct 12  2022 /etc/yum/pluginconf.d -> ../dnf/plugins
```
@traylenator
Copy link
Author

merging red on Fedora but it must be red on fedora in master branch also.
its less red that it was. Two more things to fix but they deserve their own MR.

@traylenator traylenator merged commit 7246178 into voxpupuli:master May 15, 2023
9 of 10 checks passed
@traylenator traylenator deleted the mainconf branch May 15, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants