-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #19254 - check Puppet version is supported by modules (#213)
Using the Puppet version requirements from metadata.json in the available modules, the running Puppet version is validated to ensure it is compatible. The user can skip this with `--skip-puppet-version-check` if they wish.
- Loading branch information
Showing
13 changed files
with
208 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
define kafo_configure::puppet_version_semver($requirement) { | ||
unless SemVer($facts['puppetversion']) =~ SemVerRange($requirement) { | ||
fail("kafo_configure::puppet_version_failure: Puppet ${facts['puppetversion']} does not meet requirements for ${title} ($requirement)") | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
modules/kafo_configure/manifests/puppet_version_versioncmp.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define kafo_configure::puppet_version_versioncmp($minimum = undef, $maximum = undef) { | ||
if $minimum and versioncmp($minimum, $::puppetversion) > 0 { | ||
fail("kafo_configure::puppet_version_failure: Puppet ${puppetversion} does not meet minimum requirement for ${title} (version $minimum)") | ||
} | ||
|
||
if $maximum and versioncmp($maximum, $::puppetversion) < 0 { | ||
fail("kafo_configure::puppet_version_failure: Puppet ${puppetversion} does not meet maximum requirement for ${title} (version $maximum)") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "theforeman-testing", | ||
"version": "0.0.1", | ||
"author": "The Foreman", | ||
"license": "GPL-3.0", | ||
"summary": "Testing module", | ||
"source": "https://github.com/theforeman/kafo", | ||
"project_page": "https://github.com/theforeman/kafo", | ||
"issues_url": "http://projects.theforeman.org/projects/kafo/issues/", | ||
"tags": ["kafo"], | ||
"dependencies": [], | ||
"requirements": [ | ||
{ | ||
"name": "puppet", | ||
"version_requirement": ">= 3.0.0 < 999.0.0" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "theforeman-testing", | ||
"version": "0.0.1", | ||
"author": "The Foreman", | ||
"license": "GPL-3.0", | ||
"summary": "Testing module", | ||
"source": "https://github.com/theforeman/kafo", | ||
"project_page": "https://github.com/theforeman/kafo", | ||
"issues_url": "http://projects.theforeman.org/projects/kafo/issues/", | ||
"tags": ["kafo"], | ||
"dependencies": [], | ||
"requirements": [ | ||
{ | ||
"name": "puppet", | ||
"version_requirement": ">= 1.0.0 < 2.0.0" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "theforeman-testing", | ||
"version": "0.0.1", | ||
"author": "The Foreman", | ||
"license": "GPL-3.0", | ||
"summary": "Testing module", | ||
"source": "https://github.com/theforeman/kafo", | ||
"project_page": "https://github.com/theforeman/kafo", | ||
"issues_url": "http://projects.theforeman.org/projects/kafo/issues/", | ||
"tags": ["kafo"], | ||
"dependencies": [], | ||
"requirements": [ | ||
{ | ||
"name": "puppet", | ||
"version_requirement": ">= 999.0.0 < 100.0.0" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters