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 1983760 - Hammer ansible command gives "Error: undefined method"
Summary: Hammer ansible command gives "Error: undefined method"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.10.0
Assignee: Ondřej Pražák
QA Contact: Ondrej Gajdusek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-19 17:34 UTC by Ondrej Gajdusek
Modified: 2021-11-16 14:12 UTC (History)
4 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 33165 0 Normal New Hammer ansible command gives "Error: undefined method" 2021-07-28 12:55:05 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:12:56 UTC

Description Ondrej Gajdusek 2021-07-19 17:34:08 UTC
Description of problem:
The `hammer ansible variables update` command prints the following error on stderr:

Could not update the ansible variable:
  Error: undefined method `create_search_options_without_katello_api' for #<HammerCLIForeman::IdResolver:0x00000000050fa000>
  Did you mean?  create_search_options

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

How reproducible:
Every time

Steps to Reproduce:
1. hammer ansible roles import --proxy-id 1
2. hammer ansible variables import --proxy-id 1
3. hammer ansible variables list --search c_rh_c_host # check that the variable exists
4. hammer ansible variables update --variable c_rh_c_host --new-name foo_bar

Actual results:
The command does not update the variable and returns an error.

Expected results:
The command should update the variable without an error.

Additional info:
This issue might be related to BZ1851415

Comment 1 Ondřej Pražák 2021-07-28 12:55:02 UTC
Created redmine issue https://projects.theforeman.org/issues/33165 from this bug

Comment 2 Bryan Kearney 2021-07-28 16:02:28 UTC
Upstream bug assigned to oprazak

Comment 3 Bryan Kearney 2021-07-28 16:02:30 UTC
Upstream bug assigned to oprazak

Comment 4 Bryan Kearney 2021-07-30 16:01:01 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/33165 has been resolved.

Comment 5 Bryan Kearney 2021-07-30 16:02:16 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/33165 has been resolved.

Comment 7 Ondrej Gajdusek 2021-08-16 10:16:17 UTC
VERIFIED

@Satellite 6.10.0 snap 13
foreman-2.5.2.4-1.el7sat.noarch
satellite-6.10.0-0.6.beta.el7sat.noarch

The user is able to update the variable using steps 1 and 2 from the BZ description followed by the steps below.


[root@dhcp-3-143 ~]# hammer ansible variables create --ansible-role-id 2 --variable aa_test_variable --default-value defaultval1
Ansible variable [aa_test_variable] was created.
[root@dhcp-3-143 ~]# hammer ansible variables list --search name=aa_test_variable
---|------------------|---------------|------|----------------------------------------------
ID | VARIABLE         | DEFAULT VALUE | TYPE | ROLE                                         
---|------------------|---------------|------|----------------------------------------------
43 | aa_test_variable | defaultval1   |      | project-receptor.satellite_receptor_installer
---|------------------|---------------|------|----------------------------------------------
[root@dhcp-3-143 ~]# hammer ansible variables update --name aa_test_variable --default-value defaultval2
Ansible variable [aa_test_variable] updated.
[root@dhcp-3-143 ~]# hammer ansible variables list --search name=aa_test_variable
---|------------------|---------------|------|----------------------------------------------
ID | VARIABLE         | DEFAULT VALUE | TYPE | ROLE                                         
---|------------------|---------------|------|----------------------------------------------
43 | aa_test_variable | defaultval2   |      | project-receptor.satellite_receptor_installer
---|------------------|---------------|------|----------------------------------------------

Comment 8 Ondrej Gajdusek 2021-08-16 10:17:21 UTC
Verified using tfm-rubygem-hammer_cli_foreman_ansible-0.3.4-1.el7sat.noarch

Comment 11 errata-xmlrpc 2021-11-16 14:12:49 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.