You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want a class that configures an APT repository to also ensure that apt-get update has run before any dependencies on that class.
This way I can depend on the class that configures the repository without needing to know how this repository is configured.
E.g.:
classmymod::repository {
if$facts['os']['family'] == 'Debian' {
apt::source { 'somerepo':
...
}
contain apt::update
} else {...}
}
classmymod {
require mymod::repository # Make sure that the repository is configured and available.package { 'somepackage':
ensure => 'present',
}
}
This is currently not possible by using contain apt::source because that class is private.
Instead if fails with:
error during compilation: Evaluation Error: Error while evaluating a Function Call, Class apt::update is private
Describe the Solution You Would Like
Since the apt::update class is a documented part of this module, I think it could be marked as public.
That would allow it to be used both through contain and through direct dependencies (require => Class['apt::update']).
Describe Alternatives You've Considered
Two alternatives:
Using an anchor: `Class['apt::update'] -> anchor { 'mymod::repository::last' }'. The downside of this is that anchors are deprecated and no longer documented as part of containment.
Directly depending on `Class['apt::update'] in the package resource. This only works if the repository configured is always an APT repository
The text was updated successfully, but these errors were encountered:
This issue has been open for a while and has had no recent activity. We've labelled it with attention-needed so that we can get a clear view of which issues need our attention.
If you are waiting on a response from us we will try and address your comments on a future Community Day.
Alternatively, if it is no longer relevant to you please close the issue with a comment.
Use Case
I want a class that configures an APT repository to also ensure that
apt-get update
has run before any dependencies on that class.This way I can depend on the class that configures the repository without needing to know how this repository is configured.
E.g.:
This is currently not possible by using
contain apt::source
because that class is private.Instead if fails with:
Describe the Solution You Would Like
Since the
apt::update
class is a documented part of this module, I think it could be marked as public.That would allow it to be used both through
contain
and through direct dependencies (require => Class['apt::update']
).Describe Alternatives You've Considered
Two alternatives:
The text was updated successfully, but these errors were encountered: