Skip to content

Conversation

giuliano108
Copy link
Contributor

Fixes #5 .

When computing the set of managed packages, we can't just look them up by title in the Catalog. Because title and name can be different, we need to look into the "resource aliases" table too.

package {'arbitrarytitle': name => 'pkgname'}

I couldn't find a public API to access @aliases, hence the instance_variable_get hack... :(

The @aliases data structure looks as follows:

[4] pry(#<Puppet::Type::Aptly_purge>)> catalog.instance_variable_get :@aliases
=> {"Class[Main]"=>[["Class", "main"]],
 "Package[ubuntu-minimal]"=>[["Package", "ubuntu-minimal", :held_apt]],
 "Package[puppetlabs-release-pc1]"=>[["Package", "puppetlabs-release-pc1", :held_apt]],
 "Package[puppet-agent]"=>[["Package", "puppet-agent", :held_apt]],
 "Package[openssh-server]"=>[["Package", "openssh-server", :held_apt]],
 "Package[fortunespkg]"=>[["Package", "fortunes", :held_apt]],
 "Aptly_purge[packages]"=>[["Aptly_purge", :packages]]}

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

Successfully merging this pull request may close these issues.

2 participants