Use ensure_packages to simpify packages management #122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Each one of these classes includedbacula::virtual
which in turn included both classes. As a consequence, any node declaring either abacula::director
or abacula::storage
implicitly declares the other class. This did not allowed to follow strictly the Role & Profiles pattern (see #121 (comment)) where you would like to use resource-style declaration for both classes.Thanks to stdlib's ensure_packages (available from stdlib 3.2.0, released in 2012) we can avoid the virtual resources.
This was tested successfully on FreeBSD and Debian.
Known side effects:Users have to include / declare bothbacula::director
andbacula::storage
in their configuration (this is a breaking change I guess… The README suggests to use resource-style declaration of both classes, but this setup was not working so users may have used trial-and-error to find a working setup where only one of these classes is explicitly present, and the other one was incidentally included);TheClass[Bacula::Storage]
is now reported correctly by PuppetDB (for some undetermined reason, I could not query PuppetDB for this class when it was included, and this change fix the problem… likely a problem in PuppetDB itself).