Skip to content

Commit a947724

Browse files
tpdownesbsngardner
authored andcommitted
Avoid unnecessary reboots
1 parent d1f5804 commit a947724

File tree

4 files changed

+45
-12
lines changed

4 files changed

+45
-12
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
# Copyright (C) SchedMD LLC.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
reboot: true

ansible/roles/kernel/tasks/os/debian.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,27 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15+
- block:
16+
- name: Reboot
17+
reboot:
1518

16-
- name: Reboot
17-
reboot:
19+
- name: Gather facts after reboot
20+
setup:
1821

19-
- name: Gather facts after reboot
20-
setup:
22+
when: reboot
2123

2224
- name: Install {{ansible_os_family}} Family Kernel Packages
2325
apt:
2426
name:
2527
- linux-headers-{{ansible_kernel}}
2628
state: latest
2729
update_cache: yes
30+
when: reboot
31+
32+
- name: Install {{ansible_os_family}} Family Kernel Packages
33+
apt:
34+
name:
35+
- linux-headers-generic
36+
state: latest
37+
update_cache: yes
38+
when: not reboot

ansible/roles/kernel/tasks/os/redhat-7.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
- name: Reboot
17-
reboot:
16+
- block:
17+
- name: Reboot
18+
reboot:
1819

19-
- name: Gather facts after reboot
20-
setup:
20+
- name: Gather facts after reboot
21+
setup:
22+
23+
when: reboot
2124

2225
- name: Install {{ansible_os_family}} Family Kernel Packages
2326
yum:

ansible/roles/kernel/tasks/os/redhat-8.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
state: latest
2727
update_cache: yes
2828

29-
- name: Reboot
30-
reboot:
29+
- block:
30+
- name: Reboot
31+
reboot:
3132

32-
- name: Gather facts after reboot
33-
setup:
33+
- name: Gather facts after reboot
34+
setup:
35+
36+
when: reboot

0 commit comments

Comments
 (0)