Sha256: 508e6065ccd59503ab4036bda675d4c75eaf98898d2d0d02fc2df4d57f55fb9e

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

<%#
name: Convert2RHEL analyze
snippet: false
template_inputs:
  - name: Data telemetry
    required: false
    input_type: user
    options: "yes\r\nno"
    advanced: false
    value_type: plain
    default: 'yes'
    hidden_value: false
model: JobTemplate
job_category: Convert 2 RHEL
provider_type: script
kind: job_template
%>
<% if @host.operatingsystem.family == 'Redhat' -%>
if ! [ $(id -u) -eq 0 ]; then
  echo "You must run convert2rhel as a root user."
  exit 1
fi

if ! rpm -q convert2rhel &> /dev/null; then
  yum install -y convert2rhel
fi

<% if input('Data telemetry') != "yes" -%>
export CONVERT2RHEL_DISABLE_TELEMETRY=1
<% end -%>

/usr/bin/convert2rhel analyze -y

if ! grep -q ERROR /var/log/convert2rhel/convert2rhel-pre-conversion.json; then
    echo "Error: Some error(s) have been found."
    echo "Exiting ..."
    exit 1
fi

if ! grep -q SKIP /var/log/convert2rhel/convert2rhel-pre-conversion.json; then
    echo "Warning: Some check(s) have been skipped."
    echo "Exiting ..."
    exit 1
fi
<% else %>
echo 'Unsupported OS, it must be from the Red Hat family.'
exit 1
<% end -%>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_remote_execution-11.1.0 app/views/templates/script/convert2rhel_analyze.erb
foreman_remote_execution-10.1.0 app/views/templates/script/convert2rhel_analyze.erb