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 1677309 - Not able to run Ansible playbooks under Access Insights
Summary: Not able to run Ansible playbooks under Access Insights
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: RH Cloud - Insights
Version: 6.5.0
Hardware: All
OS: All
unspecified
high
Target Milestone: 6.5.0
Assignee: satellite6-bugs
QA Contact: Radovan Drazny
URL:
Whiteboard:
: 1678045 1683407 1698935 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-14 14:05 UTC by maneesh verma
Modified: 2023-10-06 18:08 UTC (History)
17 users (show)

Fixed In Version: rubygem-foreman-redhat_access-2.2.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1712377 (view as bug list)
Environment:
Last Closed: 2019-05-14 12:40:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3688541 0 None None None 2019-03-04 08:49:07 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:40:16 UTC

Description maneesh verma 2019-02-14 14:05:44 UTC
Description of problem:

When selecting a security item for an impacted host and running insights Ansible pre-created playbook it throws an error.


How reproducible:

Every time select a playbook to run on the client from Insights.

Steps to Reproduce:

- Goto Insights tab>Actions>Select the Security Action>Select the impacted host>Actions.Create Playbook and Run playbook.


Actual results:

We see the error when we run playbook.

"Failed to create job. Ensure your systems are registered in Foreman"


Expected results:

It should run the playbook to fix the issues.

All other Ansible roles and remote execution working between the client and the Satellite.


Additional info:

Comment 2 Lindani Phiri 2019-02-15 20:06:29 UTC
@Daniel,

Can you help triage this one? Looks like it could be an issue in the Ansible plugin, but I am not sure.


Lindani

Comment 8 Nagoor Shaik 2019-02-24 02:16:38 UTC
*** Bug 1678045 has been marked as a duplicate of this bug. ***

Comment 9 Nagoor Shaik 2019-02-24 03:22:15 UTC
Hi,

This is because the hosts_ids returns the full array instead of an ID, which make the insights playbook run fails

irb(main):028:0> Host.where(:name => hostname_rules_relation.keys).pluck(&:id)
=> [[3, "rhel7.acme.lab", Sun, 24 Feb 2019 02:31:46 UTC +00:00, nil, Sun, 24 Feb 2019 02:31:47 UTC +00:00, Sun, 24 Feb 2019 02:28:03 UTC +00:00, nil, 1, 1, nil, nil, nil, false, nil, nil, nil, 1, nil, 1, "User", true, nil, false, nil, nil, nil, nil, nil, nil, nil, 1, 2, "Host::Managed", nil, nil, nil, nil, "", nil, 1, "fqdn=rhel7.acme.lab", nil, nil, nil, nil]]

After changing the syntax 

irb(main):029:0> Host.where(:name => hostname_rules_relation.keys).pluck(:id)
=> [3]

So, here is a simple fix 

  # vi /opt/theforeman/tfm/root/usr/share/gems/gems/redhat_access-2.2.0/app/models/redhat_access/concerns/host_managed_extensions.rb
    Change
    host_ids = Host::Managed.where(:name => hostname_rules_relation.keys).pluck(&:id)

    To 
    host_ids = Host::Managed.where(:name => hostname_rules_relation.keys).pluck(:id)

  Restart httpd

  # systemctl restart httpd


Opened an upstream PR for this https://github.com/redhataccess/foreman-plugin/pull/33

Comment 10 Marek Hulan 2019-02-28 14:21:48 UTC
2.2.2 contains the linked fix, packaging PR opened at https://github.com/theforeman/foreman-packaging/pull/3478

Comment 11 Marek Hulan 2019-03-04 08:49:07 UTC
*** Bug 1683407 has been marked as a duplicate of this bug. ***

Comment 12 Radovan Drazny 2019-04-01 12:17:13 UTC
Verified on tfm-rubygem-redhat_access-2.2.3-1.el7sat.
I was able to successfully run an Ansible playbook created by the planner in the Insights module, or by going through the Actions as described in the initial report. No error, playbook was processed and executed as expected.

Comment 17 Dave Johnson 2019-05-01 16:02:00 UTC
*** Bug 1698935 has been marked as a duplicate of this bug. ***

Comment 20 errata-xmlrpc 2019-05-14 12:40:09 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, 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-2019:1222

Comment 23 Red Hat Bugzilla 2023-09-15 00:15:42 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


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