Skip to content
This repository has been archived by the owner on Jun 21, 2018. It is now read-only.

added yum_params for RHEL 5 & 6 only #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jenkins101
Copy link
Contributor

yum-cron in RHEL 7 and Fedora don't support this.

This makes it possible to set any yum parameter for RHEL 5 and 6

@antoineco I am no good at the rspec stuff, do I need to do something there?

@jenkins101
Copy link
Contributor Author

Now the tests work at least.

I dont get it to work in RHEL 7?
specifying disablerepo=* enablerepo=rhel_base for example does nothing for me.

@jenkins101
Copy link
Contributor Author

fixed space in yum_params added " " inside if. dirty, should probably be added around the hole config block instead of using \

@antoineco
Copy link
Owner

If it's a repo option you need to create a [<repo-name>] block in the config file and set enable=0, just like in your yum.conf file(s).

A list of all available options is available in the man page for yum.conf(5)

If what you want is to disable a repo it would actually be wide to create a new class parameter called exclude_repos and use the same logic as for the packages exclusion.

@antoineco
Copy link
Owner

Also yum_params should be a Hash instead of a string, and the result should be processed in order to generate a result like

#RHEL6
--param1=value1 --param2=value2

#RHEL7
param1=value1
param2=value2

this way we can support all platforms equally.

@jenkins101
Copy link
Contributor Author

could it be used like this the?

#RHEL6
--disablerepo=* --enablerepo=rhel-base

#RHEL7
disablerepo=*
enablerepo=rhel-base

What I want to achieve is to disable all repos and only use one or two.
We have a lot of custom application repos that I dont want to auto update

@antoineco
Copy link
Owner

disablerepo/enablerepo are a particular case because they belong to the [repo] section of the config file, and not the main section. That means you have to use the --enablerepo syntax as a yum parameter, or to generate a block with

[yourrepo]
enable=0

For all other parameters the syntax I explained is the way to go. And the module should absolutely support all RHEL versions :)

@jenkins101
Copy link
Contributor Author

Hi,

I have tried this in many different ways now but I don't get repos to work with centos 7.
I am disabling the updates repo but it still install updates from it no matter what I try.

i have added this to the /etc/yum/yum-cron.conf_dailyupdate

[base]
...
[updates]
enabled=0

@jenkins101
Copy link
Contributor Author

Hi,

I have tested some other yum.conf options added in yum-cron.conf but it doesn't seem to work.

This makes me think that setting yum parameters is not supported in latest yum-cron.

@antoineco
Copy link
Owner

It works for me, as long as I use params from the [base] section.
You have to use the syntax from the yum.conf file:

$ man yum.conf 

@jenkins101
Copy link
Contributor Author

Could you give me a working example?

I have tried on latest centos7 to add:

[updates]
enabled=0

and

plugins=0

All in the base section.

But yum-cron still used the fastestmirror plugin and installed updates from the updates repo?

@antoineco
Copy link
Owner

Ah, I thought you meant base parameters.

Repo parameters won't work indeed, that was a wrong assumption so we'll have to use --disablerepo in that case.

I will start working on it probably by the end of the week.

@antoineco
Copy link
Owner

Still haven't taken the time to look into it yet, sorry for the delay.

@antoineco antoineco self-assigned this Dec 2, 2015
ghost pushed a commit to llua/aco-yum_autoupdate that referenced this pull request Apr 4, 2016
@antoineco antoineco force-pushed the master branch 11 times, most recently from c32fea5 to 2d60ea1 Compare July 29, 2016 17:54
@antoineco antoineco force-pushed the master branch 9 times, most recently from 4a4fe49 to 2f4f8ca Compare July 30, 2016 15:28
@antoineco antoineco force-pushed the master branch 4 times, most recently from ef1e13d to e9acfec Compare June 7, 2017 19:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants