Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1851415 - hammer hostgroup update does not respect ansible-roles argument
Summary: hammer hostgroup update does not respect ansible-roles argument
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.10.0
Assignee: Oleh Fedorenko
QA Contact: Danny Synk
URL:
Whiteboard:
: 1740414 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-26 13:17 UTC by Stefan Nemeth
Modified: 2023-12-15 18:18 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:09:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30226 0 Normal Closed hammer hostgroup update does not respect ansible-roles argument 2021-01-11 08:15:52 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:09:23 UTC

Description Stefan Nemeth 2020-06-26 13:17:04 UTC
Description of problem:

updating ansible roles in hostgroup with hammer does not respect argument

hammer hostgroup update --id 17  --ansible-roles anystring

results in adding all available roles into hostgroup

Version-Release number of selected component (if applicable):

6.7.1

How reproducible:

100%

Steps to Reproduce:
1.create hostgroup
2.import some ansible roles to satellite
3.#hammer hostgroup update --id 17  --ansible-roles rolename

Actual results:

all available roles added to hostroup

Expected results:

only roles with names matching argument string added to hostgroup

Additional info:

Comment 1 Oleh Fedorenko 2020-06-26 19:04:06 UTC
Seems like the problem appears only if hammer-cli-katello plugin is installed, since it changes name to id resolving. I suggest to improve hammer-cli-foreman-ansible plugin, so it works with/out hammer-cli-katello being installed.

Comment 2 Oleh Fedorenko 2020-06-26 19:06:01 UTC
Created redmine issue https://projects.theforeman.org/issues/30226 from this bug

Comment 3 Bryan Kearney 2020-06-26 20:00:40 UTC
Upstream bug assigned to ofedoren

Comment 4 Bryan Kearney 2020-06-26 20:00:42 UTC
Upstream bug assigned to ofedoren

Comment 5 Bryan Kearney 2020-06-29 16:00:42 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30226 has been resolved.

Comment 8 Tomer Brisker 2021-06-08 09:53:33 UTC
*** Bug 1740414 has been marked as a duplicate of this bug. ***

Comment 9 Danny Synk 2021-06-24 20:50:01 UTC
Steps to Test:

1. Import Ansible roles to Satellite 6.10, snap 5.
2. Create a host group.
3. Attempt to update the hostgroup using hammer with an arbitrary string as the value of the `--ansible-roles` option:
4. Attempt to update the hostgroup using hammer with one of the imported Ansible roles as the value of the `--ansible-roles` option:


Expected Results:
Using an arbitrary string as the value of the `--ansible-roles` option makes no changes to the Ansible roles assigned to the hostgroup. Using one or more imported roles as the value of the `--ansible-roles` option assigns those roles to the hostgroup.


Actual Results: 
Using an arbitrary string as the value of the `--ansible-roles` option makes no changes to the Ansible roles assigned to the hostgroup:

  # hammer hostgroup update --id 1 --ansible-roles testingfailure
  Could not update the hostgroup:
    Error: one of ansible_roles not found.

Using one or more imported roles as the value of the `--ansible-roles` option assigns those roles to the hostgroup:

  # hammer hostgroup update --id 1 --ansible-roles  ovirt.ovirt.infra
  Hostgroup updated.


Verified on Satellite 6.10, snap 5 (tfm-rubygem-hammer_cli_foreman_ansible-0.3.3-2.el7sat.noarch).

Comment 12 errata-xmlrpc 2021-11-16 14:09:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4702


Note You need to log in before you can comment on or make changes to this bug.