Created
October 28, 2014 21:36
-
-
Save binford2k/fb0d7e6e93e336e06f00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure that all channels are subscribed to before any packages are installed. | |
# This is evil and horrible and not right. But it's really the only way right now. | |
# TODO: use a whit to coalesce relationships for performance reasons. This won't | |
# really matter until you have many channels subscribed. | |
def autorequire(rel_catalog = nil) | |
rel_catalog ||= catalog | |
raise(Puppet::DevError, "You cannot add relationship without a catalog") unless rel_catalog | |
reqs = super | |
rel_catalog.resources.select{|x| x.is_a? Puppet::Type::Package}.each do |res| | |
reqs << Puppet::Relationship::new(self, res) | |
end | |
reqs | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment