updating grub via Ansible without presenting a dialog box

1,505 views
Skip to first unread message

Kathy L

unread,
Feb 23, 2023, 7:34:11 AM2/23/23
to Ansible Project
We are updating packages via Ansible, and when grub needs to be run after the update, it fails on Debian 11.  When I run the update command manually, grub displays a dialog box asking the user to select the grub install device (/dev/vda, /dev/vda2, /dev/vda3, etc.).

We have our playbook running with an environment variable DEBIAN_FRONTEND: noninteractive.

How do we fix this error in Ansible?

Rowe, Walter P. (Fed)

unread,
Feb 23, 2023, 7:46:45 AM2/23/23
to ansible...@googlegroups.com
Is there a way to specify the install device on the command line / in the module so it doesn't prompt?

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4eed2847-8053-4381-854d-6d0cff5b8c6cn%40googlegroups.com.

Kathy L

unread,
Feb 23, 2023, 8:03:00 AM2/23/23
to Ansible Project
That's what we started to look at, but the issue becomes during a general package update, you don't always know if grub will need to be updated.  I'm not even sure how you'd tell this in an apt-get update.

Todd Lewis

unread,
Feb 23, 2023, 1:56:48 PM2/23/23
to Ansible Project
Sounds like you'll need to `apt-mark hold grub` first, and handle updates to grub separately from the others.
Also sounds like a bug in the grub package.

Kathy L

unread,
Feb 27, 2023, 12:00:00 PM2/27/23
to Ansible Project
If we do an apt-mark hold grub first, we are left with the dilemma of how to update grub without presenting a dialog.  This is only happening on Debian 11 boxes.  We have tried using the :

  environment:
     DEBIAN_FRONTEND:  noninteractive

option, but it is not working.

Will McDonald

unread,
Feb 27, 2023, 1:08:50 PM2/27/23
to ansible...@googlegroups.com
The core problem here is a  grub / Debian issue rather than Ansible and it looks like you've already tried a few places for help. (https://unix.stackexchange.com/questions/735375/update-grub-on-debian-11-fails and https://forums.debian.net/viewtopic.php?t=154015)

1, Is it ALL Debian 11 machines or just one/a few?
2. How was(/were) the VM(s) installed/created? If you create a new, clean VM, and just do a grub-update do you have the same problem?
3. Try reviewing and feeding back on the questions/advice on either or both of SO and the Debian forum.
4. Try spinning up an AWS Debian 11 instance and compare/contrast to your broken instance(s). This is one I've just spun up moments ago:

root@ip-172-31-31-103:~# ls -l /etc/grub.d/
total 84
-rwxr-xr-x 1 root root 10046 Nov  8 17:29 00_header
-rwxr-xr-x 1 root root  6260 Nov  8 17:29 05_debian_theme
-rwxr-xr-x 1 root root 14123 Nov  8 17:29 10_linux
-rwxr-xr-x 1 root root 14180 Nov  8 17:29 20_linux_xen
-rwxr-xr-x 1 root root 12910 Nov  8 17:29 30_os-prober
-rwxr-xr-x 1 root root  1372 Nov  8 17:29 30_uefi-firmware
-rwxr-xr-x 1 root root   214 Nov  8 17:29 40_custom
-rwxr-xr-x 1 root root   215 Nov  8 17:29 41_custom
-rw-r--r-- 1 root root   483 Nov  8 17:29 README
-rw-r--r-- 1 root root     0 Jan 24 04:24 enable_cloud
root@ip-172-31-31-103:~# ls -l /etc/default/grub.d/
total 8
-rw-r--r-- 1 root root  15 Jan 24 04:27 15_timeout.cfg
-rw-r--r-- 1 root root 274 Aug  3  2022 init-select.cfg
root@ip-172-31-31-103:~# update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-21-cloud-amd64
Found initrd image: /boot/initrd.img-5.10.0-21-cloud-amd64
done

Something's borked your grub build config, you need to find and fix that.

Reply all
Reply to author
Forward
0 new messages