Project

General

Profile

Actions

Bug #29260

closed

Katello Ansible Template for yum package install missing yes flag

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

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

Actions #1

Updated by Ian Ballou about 4 years ago

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

Updated by Thomas Herbin about 4 years ago

  • Assignee set to Thomas Herbin
Actions #3

Updated by The Foreman Bot about 4 years ago

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

Updated by The Foreman Bot about 4 years ago

  • Fixed in Releases Katello 3.16.0 added
Actions #5

Updated by Thomas Herbin about 4 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF