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.

On Mon, 27 Feb 2023 at 17:00, Kathy L <[email protected]> wrote:

> 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.
>
> On Thursday, February 23, 2023 at 1:56:48 PM UTC-5 Todd Lewis wrote:
>
>> 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.
>>
>> On Thursday, February 23, 2023 at 8:03:00 AM UTC-5 Kathy L wrote:
>>
>>> 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.
>>>
>>>
>>> On Thursday, February 23, 2023 at 7:46:45 AM UTC-5 Rowe, Walter P. (Fed)
>>> wrote:
>>>
>>>> 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 <(202)%20355-4123>
>>>>
>>>> On Feb 23, 2023, at 7:34 AM, Kathy L <[email protected]> wrote:
>>>>
>>>> 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?
>>>>
>>>> --
>>>> 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 [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/ansible-project/4eed2847-8053-4381-854d-6d0cff5b8c6cn%40googlegroups.com
>>>> <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F4eed2847-8053-4381-854d-6d0cff5b8c6cn%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C7c94cb6c68a140a0e4db08db159a47d9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638127525495109790%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jis5XJwIqbyHRX32Evw0i%2F2f0RsqTdapJmfBsASM3PI%3D&reserved=0>
>>>> .
>>>>
>>>>
>>>> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/938acaff-c7de-47b5-bb56-7a59036df301n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/938acaff-c7de-47b5-bb56-7a59036df301n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKtKohShAb5vPKTRamvPKhy2T8NGvp2jNR241WWFR5Mj1fFFeg%40mail.gmail.com.

Reply via email to