Skip to content

Commit 4fb938c

Browse files
committed
Prevent hanging before reboot on systems running molly-guard
molly-guard can be used to prevent accidental reboots, prompting the user to input the system's hostname before allowing a reboot. This does not work well with automation, however. This change adds the internal reboot executable within molly-guard to the search path to avoid this issue.
1 parent e25cc4c commit 4fb938c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

etc/kayobe/ansible/reboot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@
88
- name: Reboot and wait
99
become: true
1010
reboot:
11+
search_paths:
12+
# Systems running molly-guard hang waiting for confirmation before rebooting without this.
13+
- "/lib/molly-guard"
14+
# Default list:
15+
- "/sbin"
16+
- "/bin"
17+
- "/usr/sbin"
18+
- "/usr/bin"
19+
- "/usr/local/sbin"

etc/kayobe/ansible/ubuntu-upgrade.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
reboot:
4141
reboot_timeout: "{{ reboot_timeout_s }}"
4242
connect_timeout: 600
43+
search_paths:
44+
# Systems running molly-guard hang waiting for confirmation before rebooting without this.
45+
- "/lib/molly-guard"
46+
# Default list:
47+
- "/sbin"
48+
- "/bin"
49+
- "/usr/sbin"
50+
- "/usr/bin"
51+
- "/usr/local/sbin"
4352
become: true
4453
when: file_status.stat.exists
4554

@@ -101,6 +110,15 @@
101110
reboot:
102111
reboot_timeout: "{{ reboot_timeout_s }}"
103112
connect_timeout: 600
113+
search_paths:
114+
# Systems running molly-guard hang waiting for confirmation before rebooting without this.
115+
- "/lib/molly-guard"
116+
# Default list:
117+
- "/sbin"
118+
- "/bin"
119+
- "/usr/sbin"
120+
- "/usr/bin"
121+
- "/usr/local/sbin"
104122
become: true
105123

106124
- name: Update distribution facts

0 commit comments

Comments
 (0)