Revision 0cb7253f
Added by Maximilian Kolb about 1 month ago
app/views/foreman/job_templates/update_packages_by_search_query_-_katello_ansible_default.erb | ||
---|---|---|
name: Update packages by search query - Katello Ansible Default
|
||
job_category: Katello
|
||
description_format: 'Update package(s) %{Packages search query}'
|
||
feature: katello_package_remove_by_search
|
||
feature: katello_package_update_by_search
|
||
provider_type: Ansible
|
||
template_inputs:
|
||
- name: Packages search query
|
||
... | ... | |
versions: input('Selected update versions')
|
||
) -%>
|
||
<% if package_names.empty? -%>
|
||
<%= render_template('Run Command - Ansible Default', :command => "yum -y update") %>
|
||
<%= render_template('Package Action - Ansible Default', :state => 'latest', :name => '"*"') %>
|
||
<% else -%>
|
||
---
|
||
- hosts: all
|
Also available in: Unified diff
Fixes #37340 - Use package module to update packages
In favor of just running a shell command via Ansible, you can use the
Ansible module "ansible.builtin.package" to perform package actions such
as installing, updating, and removing packages.
NOTE: "package_names.empty?" is always empty for hosts running Debian or
Ubuntu.
To imitate the behaviour of shell-based job templates in
"foreman_remote_execution", we update all packages if the user input is
empty.
introduced with 4f236c7dbff1038fa1bf96bad9c7cd458e163016
Refs #37051