| Here's a possible way forward on this:
- Add a :supports_groups feature to lib/puppet/type/package.rb
- Add a yumgroup package provider whose parent is Puppet::Provider::Package.
- Specify that the provider supports the feature: has_feature :group
- Implement install and uninstall methods that call the yum group commands, e.g. yum groupinstall X
- Implement instances method that parses the output of yum grouplist. For each installed group, produce a provider instances:
def self.instances |
packages = [] |
output = execute("#{command(:cmd)} grouplist") |
output.each_line do |line| |
# TODO: parse lines following "^Installed Packages:" |
packages << new(name: "..", ensure: :installed, provider: self.name) |
end |
packages |
rescue Puppet::ExecutionFailure => e |
raise Puppet::Error, _("Failed to list packages"), e |
end
|
- Since yum groups are managed with a different provider, we don't have to worry about their names conflicting with a yum/rpm package with the same name.
- We probably want to add support for install_options and uninstall_options, and maybe install_only.
- We might want to add support for purgeable?
But I don't think it'd make sense to support versionable or virtual_packages like the rpm and yum providers do. |