-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This removes the repo parameters from the main class, in favor of a standalone class that can be included. It uses an anchor because that can be collected in the main class to keep the correct dependency chaining while using composition.
- Loading branch information
Showing
9 changed files
with
45 additions
and
147 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,43 @@ | ||
# @summary Configure the foreman repo | ||
# @api private | ||
# Configure the foreman repo | ||
# | ||
# @param repo | ||
# The repository version to manage. This can be a specific version or nightly | ||
# | ||
# @param configure_scl_repo | ||
# If disabled the SCL repo will not be configured on Red Hat clone systems. | ||
# (Currently only installs repos for CentOS and Scientific) | ||
# | ||
# @param gpgcheck | ||
# Turn on/off gpg check in repo files (effective only on RedHat family systems) | ||
# | ||
# @param scl_repo_ensure | ||
# The ensure to set on the SCL repo package | ||
# | ||
class foreman::repo( | ||
$repo = $foreman::repo, | ||
$gpgcheck = $foreman::gpgcheck, | ||
$configure_epel_repo = $foreman::configure_epel_repo, | ||
$configure_scl_repo = $foreman::configure_scl_repo, | ||
Optional[Variant[Enum['nightly'], Pattern['^\d+\.\d+$']]] $repo = undef, | ||
Boolean $gpgcheck = true, | ||
Boolean $configure_scl_repo = $facts['os']['family'] == 'RedHat' and $facts['os']['major'] == '7', | ||
String $scl_repo_ensure = 'installed', | ||
) { | ||
if $repo { | ||
foreman::repos { 'foreman': | ||
repo => $repo, | ||
gpgcheck => $gpgcheck, | ||
before => Class['foreman::repos::extra'], | ||
before => Anchor['foreman::repo'], | ||
} | ||
|
||
if $configure_scl_repo { | ||
Foreman::Repos['foreman'] -> Package['foreman-release-scl'] | ||
} | ||
} | ||
|
||
class { 'foreman::repos::extra': | ||
configure_epel_repo => $configure_epel_repo, | ||
configure_scl_repo => $configure_scl_repo, | ||
if $configure_scl_repo { | ||
package {'foreman-release-scl': | ||
ensure => $scl_repo_ensure, | ||
before => Anchor['foreman::repo'], | ||
} | ||
} | ||
contain foreman::repos::extra | ||
|
||
# An anchor is used because it can be collected | ||
anchor { 'foreman::repo': } # lint:ignore:anchor_resource | ||
} |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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