Skip to content

Add optional version parameter to has_module() #192

@ekohl

Description

@ekohl

Currently extlib::has_module($name) can be used to check if a module is present. It could benefit from an optional parameter to check for a specific version (range). This could allow easy soft dependency checks with version numbers:

if $git {
  unless extlib::has_module('theforeman-git', '>= 5.0.0 < 8.0.0') {
    fail('theforeman-git 5.x, 6.x or 7.x is needed for this functionality')
  }
}

If the parameter is not specified, it should use the current behavior. It would be equivalent to having a default value of >= 0.

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