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 1725817 - Ansible Power job fails silently
Summary: Ansible Power job fails silently
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.9.0
Assignee: satellite6-bugs
QA Contact: Ondrej Gajdusek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-01 13:44 UTC by hprakash
Modified: 2023-09-07 20:12 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-21 13:11:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30091 0 Normal Resolved Ansible Power job fails silently 2021-02-16 15:18:38 UTC
Red Hat Product Errata RHSA-2021:1313 0 None None None 2021-04-21 13:12:11 UTC

Description hprakash 2019-07-01 13:44:10 UTC
Description of problem:
Ansible power playbooks i.e. reboot action on the hosts are not working on hosts

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


How reproducible:
Always

Steps to Reproduce:
Web UI>Hosts>select host>from 'Select Actions' drop down, select 'Schedule Remote Jobs'>select 'Ansible Power', 'Power Action - Ansible Default', 'restart' fore 'Job category', 'Job template' and 'action' attributes respectively


Actual results:
corresponding 'Actions::RemoteExecution::RunHostsJob' job gets completed successfully but host restart did not happen.

Expected results:
Host should be restarted

Additional info:

Comment 4 Bryan Kearney 2019-07-01 14:01:26 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/591 has been resolved.

Comment 6 Ranjan Kumar 2020-01-08 08:13:39 UTC
The multi-line script doesn't work using '|' with the command module. 

Workaround:
 
Modify job template "Power Action - Ansible Default - Ansible " like below

---
- hosts: all
  tasks:
    - shell: |
        echo <%= input('action') %> host && sleep 3
        <%= case input('action')
          when 'restart'
            'shutdown -r +1'
          else
            'shutdown -h +1'
          end %>

Comment 7 Nagoor Shaik 2020-01-09 05:22:09 UTC
PR opened upstream https://github.com/theforeman/community-templates/pull/592

Comment 8 Dominik Matoulek 2020-06-10 11:32:55 UTC
Created redmine issue https://projects.theforeman.org/issues/30091 from this bug

Comment 9 Bryan Kearney 2020-06-10 12:02:04 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/30091 has been resolved.

Comment 10 Brad Buckingham 2020-11-13 19:21:49 UTC
Fix is in Satellite 6.9 SNAP 1 with tfm-rubygem-foreman_ansible-6.0.0-1.el7sat.noarch

Comment 11 Ondrej Gajdusek 2021-02-22 14:59:34 UTC
Provided fix fixes the behavior.

VERIFIED using the reproducer in the description. After the job is invocated, the host is rebooted and the job's status changes to 'success' after the host reboots.

Comment 14 errata-xmlrpc 2021-04-21 13:11:48 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.9 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:1313


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