Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
HPCasCode
Commits
cf3480a9
Commit
cf3480a9
authored
8 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
when upgrading, reboot if the kernel changes
Former-commit-id:
16115379
parent
87cfd09d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/upgrade/tasks/main.yml
+19
-3
19 additions, 3 deletions
roles/upgrade/tasks/main.yml
with
19 additions
and
3 deletions
roles/upgrade/tasks/main.yml
+
19
−
3
View file @
cf3480a9
...
...
@@ -17,6 +17,11 @@
become_user
:
root
when
:
ansible_os_family=="RedHat"
-
name
:
install kernel-devel
yum
:
name=kernel-devel state=latest
become
:
true
become_user
:
root
-
name
:
get kernel-devel version
shell
:
rpm -q kernel-devel | cut -f 3,4 -d "-"
register
:
rpm_q_output
...
...
@@ -26,11 +31,22 @@
register
:
uname_r_output
-
name
:
default dont reboot
set_fact
:
reboot_now=False
set_fact
:
reboot_now
:
false
-
name
:
debug1
debug
:
var=rpm_q_output
-
name
:
debug2
debug
:
var=uname_r_output
-
name
:
set reboot when kernel has changed
set_fact
:
reboot_now=True
when
:
not rpm_q_output.stdout in uname_r_output.stdout
set_fact
:
reboot_now
:
true
when
:
not uname_r_output.stdout in rpm_q_output.stdout
-
name
:
debug3
debug
:
var=reboot_now
-
name
:
restart machine
shell
:
"
sleep
5;
sudo
shutdown
-r
now"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment