Bug 1907978
| Summary: | Error on enable repo using repository_set when prior configured through UI | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Steffen Froemer <sfroemer> |
| Component: | Ansible Collection | Assignee: | Evgeni Golov <egolov> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Peter Ondrejka <pondrejk> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.8.0 | CC: | egolov, jsherril, ldelouw, zhunting |
| Target Milestone: | Unspecified | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-04-09 05:33:47 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1919321 | ||
| Bug Blocks: | |||
So, my memory says this is (most probably) related to https://projects.theforeman.org/issues/28644 Some of our CDN repositories use "basearch", some "releasever" and some both (and some none of these) as place-holders in the URL. To find the right repository using ansible, you need to provide values for that, and the module then fetches all "enable-able" repos from a set and matches based on your input. Now the bug I linked above resulted in some repos that e.g. don't have the "basearch" place-holder be enabled WITH the placeholder if done in the UI -- and then ansible can't find that the set is enabled and then things go south (it tries to enable it and fails) Thanks, that helps me to investigate further. As soon I have more clarification on this, I will provide feedback. Hey,
can I please get the output of the following playbook in an affected environment? It should only dump the EL6 kickstarts
---
- hosts: localhost
gather_facts: false
vars:
server_url: https://foreman.example.com
username: admin
password: changeme
validate_certs: False
organization: "Default Organization"
search: label=rhel-6-server-kickstart
tasks:
- name: "Search for possible repository sets of a product"
theforeman.foreman.resource_info:
username: "{{ username }}"
password: "{{ password }}"
server_url: "{{ server_url }}"
validate_certs: "{{ validate_certs }}"
organization: "{{ organization }}"
resource: repository_sets
search: "{{ search }}"
register: data
- name: "Output found repository sets, see the contentUrl section for possible repository substitutions"
debug:
var: data
- name: "get available"
uri:
url: "{{ server_url }}/katello/api/products/{{ item['product']['id'] }}/repository_sets/{{ item['id'] }}/available_repositories"
url_username: "{{ username }}"
url_password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
force_basic_auth: True
register: available
loop: "{{ data.resources }}"
- name: debug
debug:
var: item
loop: "{{ available.results | map(attribute='json') | list }}"
obviously with redhat.satellite.resource_info if you use the satellite collection :) I've linked a BZ that should clean up part of this bug on the Katello side, but I don't see how that *exact* issue should affect 6.10 kickstarts, as those DO have both basearch and releasever substitutions. The output of the playbook would be greatly appreciated. to clarify: this doesn't feel the same as the linked BZ finds the repo, tries to enable it and fails as it's already enabled. here it's not finding the repo in the first place. Can you please re-run the playbook with "timeout: 300" set on the "uri" task? So:
- name: "get available"
uri:
url: "{{ server_url }}/katello/api/products/{{ item['product']['id'] }}/repository_sets/{{ item['id'] }}/available_repositories"
url_username: "{{ username }}"
url_password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
force_basic_auth: True
timeout: 300
register: available
loop: "{{ data.resources }}"
intentation error…
- name: "get available"
uri:
url: "{{ server_url }}/katello/api/products/{{ item['product']['id'] }}/repository_sets/{{ item['id'] }}/available_repositories"
url_username: "{{ username }}"
url_password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
force_basic_auth: True
timeout: 300
register: available
loop: "{{ data.resources }}"
After talking to Justin, this might be a case of https://bugzilla.redhat.com/show_bug.cgi?id=1899313 and we should re-try on a newer Satellite. Specifically 6.8.2 or newer > "after upgrade to version 6.8.5 everything is working fine."
closing as "CURRENTRELEASE" then, thanks!
|
Description of problem: Using 'repository_set' from redhat.satellite to enable Red Hat Repositories will fail, when the repo was enabled and in use through UI before. Version-Release number of selected component (if applicable): ansible-collection-redhat-satellite-1.3.0-1.el7sat.noarch How reproducible: Seen it several times, but unable to reproduce. 1) Add RH repo in UI 2) Add RH repo in UI and synchronized 3) Add RH repo in UI, synchronized and Published a CV In all three scenarios, I was able to configure the repository using the ansible role. Steps to Reproduce: 1. unclear 2. 3. Actual results: It's failing with error TASK [Enable Red Hat Kickstart repositories] *********************************************************************$ ok: [sat6.example.com] => (item={u'repos': [{u'basearch': u'x86_64', u'releasever': u'7.7'}, {u'basearch'$ u'x86_64', u'releasever': u'7.8'}], u'label': u'rhel-7-server-kickstart'}) failed: [sat6.example.com] (item={u'repos': [{u'basearch': u'x86_64', u'releasever': u'6.10'}], u'label': u'rhel-6-server-kickstart'}) => {"ansible_loop_var": "item", "changed": false, "item": {"label": "rhel-6-server-ki$kstart", "repos": [{"basearch": "x86_64", "releasever": "6.10"}]}, "msg": "Desired repositories are not available $n the repository set label: rhel-6-server-kickstart.\nSearched: {'repositories': [{'basearch': 'x86_64', 'releasev$r': '6.10'}], 'label': 'rhel-6-server-kickstart'}\nFound: []\nAvailable: []"} Remove through UI and enable it again using ansible, everything is fine. Expected results: It should work out of the box. Additional info: --- - hosts: localhost gather_facts: false vars_files: - group_vars/all.yml vars: redhat_kickstart_repos: - label: "rhel-7-server-kickstart" repos: - { releasever: "7.7", basearch: "x86_64" } - { releasever: "7.8", basearch: "x86_64" } - label: "rhel-6-server-kickstart" repos: - { releasever: "6.10", basearch: "x86_64" } collections: - redhat.satellite tasks: - name: "Enable Red Hat Kickstart repositories" repository_set: username: "{{ satellite_username }}" password: "{{ satellite_password }}" server_url: "{{ satellite_url }}" organization: "{{ satellite_organization }}" validate_certs: "{{ validate_certs }}" label: "{{ item.label }}" state: enabled repositories: "{{ item.repos }}" loop: "{{ redhat_kickstart_repos }}" tags: - enable_redhat_kickstart_repos - repos