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

[Feature Request] Add an exclude.d directory and allow multiple files to be specified #1705

Open
z900collector opened this issue Sep 17, 2024 · 2 comments

Comments

@z900collector
Copy link

Reason: When using an IaC tool, the need may arise to specify multiple packages to exclude. Rather than "corrupt" the last line of the dnf.conf file, a directory suitably called exclude.d could be used to specify one or more files (ending in .conf) which has the exclude line in it.
Example
/etc/dnf/exclude.d/01-kernel.conf

Contents of file:
exclude=kernel*

The exclude file(s) could then be uploaded or removed by the IaC tool (such as SaltStack) without needing to alter the dnf.conf file.
I often need to lock a HPC compute node with exclude=kernel* oracle* redhat* slurm* and this might cause an issue if the dnf.conf file is changed in a future release. However if this was 4 separate files then the IaC tool can deploy and manage them safer.

@kontura
Copy link
Contributor

kontura commented Sep 18, 2024

There already is support for drop-in configuration files. Check out: https://dnf5.readthedocs.io/en/latest/dnf5.conf.5.html#drop-in-configuration-directories, you don't have to change dnf.conf.

However the conf files override each other so you would have to specify all your packages in one excludepkgs option.

@jrohel
Copy link
Contributor

jrohel commented Sep 19, 2024

However the conf files override each other

Yes, that is true

so you would have to specify all your packages in one excludepkgs option.

No. excludepkgs is the "append" option. This means that the new values are appended to the existing ones. If you want to replace the existing contents of excludepkgs, then you must start with an empty value.

Examples:
Adding package_name to the list of excluded packages: excludepkgs = package_name
Replace the list of excluded packages with a new one containing only package_name: excludepkgs = ,package_name

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

3 participants