Skip to content

Commit

Permalink
Fixes #36723 - Remove Fedora/Red Hat Atomic related code
Browse files Browse the repository at this point in the history
As far as I can see this has been EOL for a few years now. Red Hat
Atomic went EOL in 2021.
  • Loading branch information
ekohl authored and stejskalleos committed Oct 4, 2023
1 parent 300efc3 commit 4e205ba
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 244 deletions.
5 changes: 0 additions & 5 deletions app/services/katello/rhsm_fact_parser.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
module Katello
REDHAT_ATOMIC_HOST_DISTRO_NAME = "Red Hat Enterprise Linux Atomic Host".freeze
REDHAT_ATOMIC_HOST_OS = "RedHat_Enterprise_Linux_Atomic_Host".freeze

class RhsmFactParser < ::FactParser
def architecture
name = facts['lscpu.architecture'] || facts['uname.machine']
Expand Down Expand Up @@ -146,8 +143,6 @@ def get_rhsm_mac(interface)
end

def distribution_to_puppet_os(name)
return REDHAT_ATOMIC_HOST_OS if name == REDHAT_ATOMIC_HOST_DISTRO_NAME

case name.downcase
when /red\s*hat/
'RedHat'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ require:
options << "domain=#{@host.domain}"
options << 'console-setup/ask_detect=false console-setup/layout=USA console-setup/variant=USA keyboard-configuration/layoutcode=us localechooser/translation/warn-light=true localechooser/translation/warn-severe=true'
options << "locale=#{host_param('lang') || 'en_US'}"
options << "inst.stage2=#{@host.operatingsystem.medium_uri(@host)}" if @host.operatingsystem.name.match(/Atomic/i)
extra = []
extra << "--kexec-file-syscall" if @host.pxe_loader.include?('SecureBoot')
-%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ require:
dns = @host.facts['discovery_dns']
options = ["nomodeset"]
options << @host.facts['append']
options << "inst.stage2=#{@host.operatingsystem.medium_uri(@host)}" if @host.operatingsystem.name.match(/Atomic/i)
if @host.operatingsystem.name != 'Fedora' && @host.operatingsystem.major.to_i >= 7 && host_param_true?('fips_enabled')
options.push('fips=1')
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ require:
options << 'ramdisk_size=1500000'
options << 'fsck.mode=skip'
options << 'cloud-config-url=/dev/null'
options << "inst.stage2=#{@host.operatingsystem.medium_uri(@host)}" if @host.operatingsystem.name.match(/Atomic/i)
-%>
{
"kernel": "<%= @kernel_uri %>",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,7 @@ description: |
end
end

# optional repository for Atomic
if @host.operatingsystem.name.match(/Atomic/i)
options.push("inst.repo=#{medium_uri}")
end

if @host.operatingsystem.name.match(/Atomic/i) || host_param('kickstart_liveimg')
if host_param('kickstart_liveimg')
options.push("inst.stage2=#{medium_uri}")
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ description: |
activation_key = <key> Activation key string, not needed if using
subscription-manager with username/password
atomic = [true|false] Whether or not this system is Atomic
Parameters for use with subscription-manager (Red Hat CDN, Satellite, or Katello)
subscription_manager = 'true' You're going to use subscription-manager
Expand All @@ -29,9 +27,6 @@ description: |
subscription_manager_certpkg_url = <url> Custom certificate package URL
subscription_manager_atomic_url = <url> Script used for configuring Atomic servers
for subscription-manager
subscription_manager_org = <org name> Organization name, if required
subscription_manager_repos = <repos> Additional repositories to enable
Expand Down Expand Up @@ -78,18 +73,14 @@ description: |
<% if registration_type == 'subscription_manager' %>
<%
atomic = @host.operatingsystem.respond_to?(:atomic) ? @host.operatingsystem.atomic? : host_param_true?('atomic')

if host_param('kt_activation_keys')
subscription_manager_certpkg_url = subscription_manager_configuration_url(@host)
subscription_manager_atomic_url = subscription_manager_configuration_url(@host, false)
subscription_manager_org = @host.rhsm_organization_label
activation_key = host_param('kt_activation_keys')
redhat_install_host_tools = host_param_true?('redhat_install_host_tools', true)
redhat_install_host_tracer_tools = host_param_true?('redhat_install_host_tracer_tools')
else
subscription_manager_certpkg_url = host_param('subscription_manager_certpkg_url')
subscription_manager_atomic_url = host_param('subscription_manager_atomic_url')
subscription_manager_org = host_param('subscription_manager_org')
activation_key = host_param('activation_key')
redhat_install_host_tools = host_param_true?('redhat_install_host_tools')
Expand All @@ -103,30 +94,26 @@ description: |
echo
echo "Starting the subscription-manager registration process"

<% if !atomic %>
# Avoid timeout accessing unreachable repo on air gapped infrastructure,
# assuming subscription-manager is installed in custom packages section.
if ! rpm --query --quiet subscription-manager ; then
if [ -f /usr/bin/dnf ]; then
dnf -y install subscription-manager
else
yum -t -y install subscription-manager
fi
fi

<%- if (host_param('syspurpose_role') || host_param('syspurpose_usage') || host_param('syspurpose_sla') || host_param('syspurpose_addons')) %>
# Avoid timeout accessing unreachable repo on air gapped infrastructure,
# assuming subscription-manager is installed in custom packages section.
if ! rpm --query --quiet subscription-manager ; then
# assuming subscription-manager-syspurpose is installed in custom packages section.
if ! rpm --query --quiet subscription-manager-syspurpose ; then
if [ -f /usr/bin/dnf ]; then
dnf -y install subscription-manager
dnf -y install subscription-manager-syspurpose
else
yum -t -y install subscription-manager
yum -t -y install subscription-manager-syspurpose
fi
fi
<% end %>
<%- if (host_param('syspurpose_role') || host_param('syspurpose_usage') || host_param('syspurpose_sla') || host_param('syspurpose_addons')) %>
<%- if !atomic %>
# Avoid timeout accessing unreachable repo on air gapped infrastructure,
# assuming subscription-manager-syspurpose is installed in custom packages section.
if ! rpm --query --quiet subscription-manager-syspurpose ; then
if [ -f /usr/bin/dnf ]; then
dnf -y install subscription-manager-syspurpose
else
yum -t -y install subscription-manager-syspurpose
fi
fi
<%- end %>

if [ -f /usr/sbin/syspurpose ]; then
<%- if host_param('syspurpose_role') %>
Expand Down Expand Up @@ -161,9 +148,7 @@ description: |
<% end %>
<% end %>
<% if atomic %>
curl -s <%= subscription_manager_atomic_url %> | IS_ATOMIC=true bash
<% elsif subscription_manager_certpkg_url %>
<% if subscription_manager_certpkg_url %>
rpm -Uvh <%= subscription_manager_certpkg_url %>
<% end %>
Expand Down Expand Up @@ -211,22 +196,20 @@ description: |
done
<% end %>
<% if !atomic %>
<% if redhat_install_host_tools || redhat_install_host_tracer_tools %>
if [ -f /usr/bin/dnf ]; then
PACKAGE_MAN="dnf -y"
else
PACKAGE_MAN="yum -t -y"
fi
<% end %>
<% if redhat_install_host_tools || redhat_install_host_tracer_tools %>
if [ -f /usr/bin/dnf ]; then
PACKAGE_MAN="dnf -y"
else
PACKAGE_MAN="yum -t -y"
fi
<% end %>
<% if redhat_install_host_tools %>
$PACKAGE_MAN install katello-host-tools
<% end %>
<% if redhat_install_host_tools %>
$PACKAGE_MAN install katello-host-tools
<% end %>
<% if redhat_install_host_tracer_tools %>
$PACKAGE_MAN install katello-host-tools-tracer
<% end %>
<% if redhat_install_host_tracer_tools %>
$PACKAGE_MAN install katello-host-tools-tracer
<% end %>
<% end %>
Expand Down
5 changes: 0 additions & 5 deletions db/seeds.d/100-installation_media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
:os_family => "Redhat",
:path => "http://dl.fedoraproject.org/pub/fedora/linux/releases/$major/Server/$arch/os/",
},
{
:name => "Fedora Atomic mirror",
:os_family => "Redhat",
:path => "http://dl.fedoraproject.org/pub/alt/atomic/stable/Cloud_Atomic/$arch/os/",
},
{
:name => "FreeBSD mirror",
:os_family => "Freebsd",
Expand Down
1 change: 0 additions & 1 deletion test/unit/foreman/renderer/snapshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ files:
- PXELinux/pxelinux_chain_ipxe_undi.erb
- provision/alterator_default.erb
- finish/alterator_default_finish.erb
- provision/atomic_kickstart_default.erb
- provision/autoyast_default.erb
- provision/autoyast_sles_default.erb
- PXELinux/autoyast_default_pxelinux.erb
Expand Down

This file was deleted.

0 comments on commit 4e205ba

Please sign in to comment.