Skip to content

[Feature] Only ensure package is latest if it is installed #357

Open
@datorr2

Description

@datorr2

Use Case

I would like to be able to ensure that certain packages are the latest version only if they are currently installed. If they are not installed, allow them to remain absent.

Describe the Solution You Would Like

Currently, ensure => latest will install the package if it is absent, and then ensure it is the latest version. This is not what I desire in certain use-cases.

In light of this, one possible solution would be to add an additional option that could be paired with ensure => present|1.0.0|etc. that would change the behavior to only correct if the package already exists/is currently installed.

Describe Alternatives You've Considered

I could write some conditional code to determine if the package is already installed before applying this condition, but that would require enumerating existing packages. As far as I know, this functionality does not currently exist in this module, which would mean having to either hack together an Exec statement to determine if the package is installed, or write a custom Facter to enumerate installed packages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions