Skip to content

Commit

Permalink
Add final upgrade step to check if reboot needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Oct 9, 2023
1 parent 249ce77 commit f6b31c7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions definitions/procedures/packages/check_for_reboot.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Procedures::Packages
class CheckForReboot < ForemanMaintain::Procedure
metadata do
description 'Check if system needs reboot'
end

def run
status, output = execute_with_status('dnf needs-restarting --reboothint')
if status == 1
set_status(:warning, output)
else
set_status(:success, output)
end
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_capsule_6_15.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class PostUpgradeChecks < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_capsule_6_15_z.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class PostUpgradeChecks < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_satellite_6_15.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class PostUpgradeChecks < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
end
end
end
1 change: 1 addition & 0 deletions definitions/scenarios/upgrade_to_satellite_6_15_z.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class PostUpgradeChecks < Abstract
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_step(Procedures::Packages::CheckForReboot)
end
end
end

0 comments on commit f6b31c7

Please sign in to comment.