Skip to content

Commit

Permalink
Add ipv6 disable check
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed May 13, 2024
1 parent 258aac2 commit 9e9dc16
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 0 deletions.
23 changes: 23 additions & 0 deletions definitions/checks/check_ipv6_disable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class Checks::CheckIpv6Disable < ForemanMaintain::Check
metadata do
label :check_ipv6_disable
description 'Check if ipv6.disable=1 is set at kernel level'
end

def run
grub_file = File.read('/etc/default/grub')

assert(
!grub_file.include?("ipv6.disable=1"),
"The kernel contains ipv6.disable=1 which is known to break installation and upgrade, remove and reboot before continuining."

Check failure on line 12 in definitions/checks/check_ipv6_disable.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Layout/LineLength: Line is too long. [131/100]
)
end

def error_message
base = "The kernel contains ipv6.disable=1 which is known to break installation and upgrade, remove and reboot before continuining."

Check failure on line 17 in definitions/checks/check_ipv6_disable.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Layout/LineLength: Line is too long. [136/100]

if feature(:instance).downstream
base += "See https://access.redhat.com/solutions/5045841 for more details."

Check failure on line 20 in definitions/checks/check_ipv6_disable.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/UselessAssignment: Useless assignment to variable - `base`.
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def compose
Checks::SystemRegistration,
Checks::CheckHotfixInstalled,
Checks::CheckTmout,
Checks::CheckIpv6Disable,
Checks::CheckUpstreamRepository,
Checks::Disk::AvailableSpace,
Checks::Disk::AvailableSpaceCandlepin, # if candlepin
Expand Down
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_capsule_6_16.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PreUpgradeCheck < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
add_step(Checks::CheckIpv6Disable)
add_step(Checks::Disk::AvailableSpacePostgresql13)
add_step(Checks::Repositories::Validate.new(:version => '6.16'))
end
Expand Down
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_capsule_6_16_z.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PreUpgradeCheck < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
add_step(Checks::CheckIpv6Disable)
add_step(Checks::Repositories::Validate.new(:version => '6.16'))
end
end
Expand Down
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_satellite_6_16.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PreUpgradeCheck < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
add_step(Checks::CheckIpv6Disable)
add_step(Checks::Disk::AvailableSpacePostgresql13)
add_step(Checks::Repositories::Validate.new(:version => '6.16'))
add_step(Checks::CheckOrganizationContentAccessMode)
Expand Down
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_satellite_6_16_z.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PreUpgradeCheck < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
add_step(Checks::CheckIpv6Disable)
add_step(Checks::Repositories::Validate.new(:version => '6.16'))
end
end
Expand Down

0 comments on commit 9e9dc16

Please sign in to comment.