Project

General

Profile

Bug #29260

Katello Ansible Template for yum package install missing yes flag

Added by Thomas Herbin about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Hi there,

I modified REX Behavior via the "REX Features" to use "Katello Ansible Default" Templates instead of the "Katello SSH Default"
So, From the Katello GUI, on a content Host, and selecting the "Upgrade Selected" triggers an Ansible Tasks

The "Update Package - Katello Ansible Default" Job template is used. However this hangs indefinitely on my host. I found out why. The Template generate the following Ansible task :

---
- hosts: all
  tasks:
    - shell:
        cmd: |
          yum update $USER_INPUT[package]
      register: out
    - debug: var=out

Because the "shell" is used and not the Ansible Yum plugin, the missing "-y" means that the host doesn't update packages.
Adding the -y fixes the problem.
For example the following :

<%= render_template('Run Command - Ansible Default', :command => "yum update -y #{input('package')}") %>

Works nicely.

This error appears in multiple other templates :
  • Install Errata - Katello Ansible Default
  • Install Group - Katello Ansible Default
  • Remove Group - Katello Ansible Default
  • Update Group - Katello Ansible Default
  • Update Package - Katello Ansible Default

The only template not impacted is : "Install Package - Katello Ansible Default".
This is Due to the fact that the template doesn't use the Ansible shell tasks, it uses the Package module, which is maybe the way forward to fix the other templates ?

Best Regards

Associated revisions

Revision 21bffbad (diff)
Added by Thomas Herbin about 2 years ago

Fixes #29260 - Add -y flag for yum command (#8599)

The Katello Ansible default action using yum with ansible shell command
were missing a -y flag which made them hang when used on a host

History

#1 Updated by Ian Ballou about 2 years ago

  • Triaged changed from No to Yes
  • Target version set to Katello 3.15.1

#2 Updated by Thomas Herbin about 2 years ago

  • Assignee set to Thomas Herbin

#3 Updated by The Foreman Bot about 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/8599 added

#4 Updated by The Foreman Bot about 2 years ago

  • Fixed in Releases Katello 3.16.0 added

#5 Updated by Thomas Herbin about 2 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF