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

RHEL: handling repos NOT via subscription-manager #96

Closed
sfuerte opened this issue May 30, 2019 · 3 comments
Closed

RHEL: handling repos NOT via subscription-manager #96

sfuerte opened this issue May 30, 2019 · 3 comments
Labels

Comments

@sfuerte
Copy link

sfuerte commented May 30, 2019

Hi,

Is it possible to implement handling repos in RHEL NOT via subscription-manager? Either by default, or have it configurable? Or if it's not available then do it via yum-config-manager?

A case: an organization has its own copy of repos and points/proxies all requests to it. So there is no active subscriptions on internal VMs, especially those for dev and test purposes:

# subscription-manager repos --list
This system has no repositories available through subscriptions.

As a result, the role fails upon execution:

fatal: [<server>]: FAILED! => {"changed": true, "cmd": "subscription-manager repos --enable=rhel-7-server-extras-rpms", "delta": "0:00:00.413478", "end": "2019-05-30 08:48:47.087075", "msg": "non-zero return code", "rc": 1, "start": "2019-05-30 08:48:46.673597", "stderr": "", "stderr_lines": [], "stdout": "Error: 'rhel-7-server-extras-rpms' does not match a valid repository ID. Use \"subscription-manager repos --list\" to see valid repositories.", "stdout_lines": ["Error: 'rhel-7-server-extras-rpms' does not match a valid repository ID. Use \"subscription-manager repos --list\" to see valid repositories."]}

I have a quick [cratchie] fix in the scripts to update the role upon installation, but really would love to have a way for it embedded in the role, so there wouldn't be any need to override it every time.

sed -i 's/subscription-manager repos \-\-list-enabled | grep rhel-7-server-extras-rpms/yum repolist all | grep RHEL_7_Extras_repo | grep enabled/' /etc/ansible/roles/haxorof.docker_ce/tasks/setup-repository-RedHat.yml
sed -i 's/subscription-manager repos --enable=rhel-7-server-extras-rpms/yum-config-manager --enable RHEL_7_Extras_repo/' /etc/ansible/roles/haxorof.docker_ce/tasks/setup-repository-RedHat.yml
@sfuerte sfuerte added the change label May 30, 2019
@haxorof
Copy link
Owner

haxorof commented May 30, 2019

Thanks @sfuerte! I will have a look at this.

haxorof added a commit that referenced this issue May 30, 2019
@haxorof
Copy link
Owner

haxorof commented May 30, 2019

I have created a default configuration (docker_rhel_repos) that you now can override. The configuration that you would require is the following:

docker_rhel_repos:
  - id: RHEL_7_Extras_repo
    repo_manager: yum
    state: enabled

Please try it out and tell me if it works for you or not.

Cheers!

@haxorof
Copy link
Owner

haxorof commented Jun 5, 2019

Please reopen if the mechanism provided is not enough.

Cheers!

@haxorof haxorof closed this as completed Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants