-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Support ensuring all yum group packages are installed #140
Conversation
if $ensure == 'latest' { | ||
exec { "yum-groupinstall-${name}-latest": | ||
command => join(concat(["yum -y groupinstall '${name}'"], $install_options), ' '), | ||
onlyif => "yum groupinfo '${name}' | egrep '\\s+\\+'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain what you're expecting to filter with egrep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is looking for +package
in the list from groupinfo
. If there is no package with +
(plus sign) then all packages in the package group are installed and it's not necessary to run yum groupinstall
. If a package in the package list has +
then it is in the group but not installed on the system so yum groupinstall
will ensure all packages get installed.
The existing Exec covers the initial install but the output from yum grouplist hidden $group
does not change if some packages are added to a group after it's installed. This PR covers that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment what the regex is meant to do above the regex.
I've applied this PR to my environment where I had a local package group installed. I then added 2 packages to that group and ran Puppet and this change allowed my systems to pick up that package group update and install the new additions to the group. Before this change I'd have to manually install additional packages via something like mcollective. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me
I like it. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i'm right the latest option just ensure all packages from the given group are installed? If yes, i guess we can accept it.
@othalla Correct, latest just ensures the entire group is installed, doesn't check to see if they are the newest version. |
Any update on getting this merged? |
@bastelfreak what do you think? |
if $ensure == 'latest' { | ||
exec { "yum-groupinstall-${name}-latest": | ||
command => join(concat(["yum -y groupinstall '${name}'"], $install_options), ' '), | ||
onlyif => "yum groupinfo '${name}' | egrep '\\s+\\+'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment what the regex is meant to do above the regex.
Pull Request (PR) description
Update
yum::group
to have additional state oflatest
that will ensure all mandatory packages of a group are always installed.When a mandatory package is not installed for a group that is installed it will be prefixed with
+
. Without this change any changes to a mandatory package list would never get installed without manual intervention.We use package groups to ensure baseline package list and it's much faster to apply one package group than dozens of individual Package resources.