Sha256: 90b8a0690d6fa21b4aae142865b9ca022268985cd8bc2dbabdc1b4587abb2437

Contents?: true

Size: 1003 Bytes

Versions: 56

Compression:

Stored size: 1003 Bytes

Contents

<%#
kind: job_template
name: Check Update - Script Default
model: JobTemplate
job_category: Packages
description_format: "Check for package updates"
provider_type: script
%>

<%
  supported_families = ['Redhat', 'Debian', 'Suse']
  render_error(N_('Unsupported or no operating system found for this host.')) unless @host.operatingsystem && supported_families.include?(@host.operatingsystem.family)

  command = case @host.operatingsystem.family
            when 'Redhat'
              'yum check-update'
            when 'Debian'
              'apt list --upgradable'
            when 'Suse'
              'zypper list-updates'
            end
-%>

<%= command %>
<% if command.start_with? 'yum' %>
rc=$?
# yum check-update returns 100 when there are updates available
if [ $rc -eq 100 ]; then
    # In this case, we override the exit code to 0 so Remote Execution
    # can consider this run as successful
    (exit 0)
else
    # For any other exit code, we don't modify it
    (exit $rc)
fi
<% end %>

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.1 app/views/templates/script/check_update.erb
foreman_remote_execution-14.1.0 app/views/templates/script/check_update.erb
foreman_remote_execution-14.0.2 app/views/templates/script/check_update.erb
foreman_remote_execution-14.0.1 app/views/templates/script/check_update.erb
foreman_remote_execution-13.2.6 app/views/templates/script/check_update.erb
foreman_remote_execution-14.0.0 app/views/templates/script/check_update.erb
foreman_remote_execution-13.2.5 app/views/templates/script/check_update.erb
foreman_remote_execution-13.2.4 app/views/templates/script/check_update.erb
foreman_remote_execution-13.2.3 app/views/templates/script/check_update.erb
foreman_remote_execution-13.2.2 app/views/templates/script/check_update.erb
foreman_remote_execution-12.0.7 app/views/templates/script/check_update.erb
foreman_remote_execution-13.2.1 app/views/templates/script/check_update.erb
foreman_remote_execution-13.2.0 app/views/templates/script/check_update.erb
foreman_remote_execution-10.1.3 app/views/templates/script/check_update.erb
foreman_remote_execution-13.0.0 app/views/templates/script/check_update.erb
foreman_remote_execution-12.0.5 app/views/templates/script/check_update.erb
foreman_remote_execution-12.0.4 app/views/templates/script/check_update.erb
foreman_remote_execution-12.0.1 app/views/templates/script/check_update.erb
foreman_remote_execution-12.0.2 app/views/templates/script/check_update.erb
foreman_remote_execution-11.1.3 app/views/templates/script/check_update.erb