Bug #29260
closedKatello Ansible Template for yum package install missing yes flag
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
Updated by Ian Ballou almost 5 years ago
- Target version set to Katello 3.15.1
- Triaged changed from No to Yes
Updated by The Foreman Bot almost 5 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/8599 added
Updated by The Foreman Bot almost 5 years ago
- Fixed in Releases Katello 3.16.0 added
Updated by Thomas Herbin almost 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|21bffbadc4cc9e0acb29213704be6ab9840b66d5.