Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added SCL repo support #67

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
$full_refresh_on_yum = 0,
$package_ensure = 'latest',
$repo_extras = false,
$repo_optional = false
$repo_optional = false,
$repo_scl = false,
) {

if ($rh_user == undef and $rh_password == undef) and ($org == undef and $activationkey == undef) {
Expand Down Expand Up @@ -169,4 +170,10 @@
}
}

if $repo_scl {
::rhsm::repo { "rhel-server-rhscl-${::operatingsystemmajrelease}-rpms":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mirrored/cloned channels provided by redhat satellite or other tools might not use this repo name.

what if redhat decides to change channel names as they did for example with oracle jre/jdk channels?

I think the boolean param thing is not a good way to provide options for these additional channels.

the rhsm module should not try to guess repo names.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but is there a way to get the same result, using a manifest or hiera, without having to change the module?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ubellavance I don't know your puppet setup. if you go with the roles/profiles pattern:

class profiles::rhsm {
  include ::rhsm
  rhsm::repo { "rhel-server-rhscl-${::operatingsystemmajrelease}-rpms"
}

if you need to pass config by hiera data a new $repos rhsm class parameter might be good.

class rhsm(
  ...
  Optional[Array[String]] $repos = undef,
  ...
) {
  ...
  repos.each do |String repo| {
    ::rhsm::repo { $repo: }
  }
}

as per #66 (comment) - the code depends on if puppet3 server needs to be supported or not (this code is not puppet3 server compatible)

if the rhsm::repo supports params, then the $repos param maybe should not be an array but an hash with support for the params of rhsm::repo.

require => Exec['RHSM-register'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the defined type rhsm::repo should take care about ordering of the resource itself instead of having each caller adding manual dependencies?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense, but I would have no idea of how to do it, unfortunately.

}
}

}