I'm back.  Now the problem I have has migrated to Debian 11.  I am trying 
to update packages which gives me the error below. So then I try to install 
grub-pc by its own which does not work.  Any further ideas?

Here is the code I am using and still I get the error "dpkg: dependency 
problems prevent configuration of grub2" and my ansible playbook dies.


- name: Get drive
  set_fact:
    drive_name: "{{ ansible_mounts| json_query(query) }}"
  vars:
    query: "[?mount=='/'].device"

- name: Install debconf-utils
  apt:
    name: debconf-utils
state: present

- name: setup grub-pc
  shell: echo "grub-pc grub-pc/install_devices multiselect {{ drive_name 
}}" | debonf-set-selections
  
- name: setup debconf
  shell" echo 'debconf debconf/frontend select Noninteractive' | 
debconf-set-selections"

- name: Copy debconf selections
  debconf-set-selections | grep grub-pc > /tmp/grubpc.debconf
 
- name: Load new grub-pc config
  shell: debconf-set-selections < /tmp/grubpc.debconf

- name: Install grub
  apt:
    name: "{{ item }}"
state: latest
  environment:
    DEBIAN_FRONTEND: noninteractive
  loop:
    - grub-pc
- grub

-- 
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/331da144-3091-47f9-bcdd-6c4e9511a42bn%40googlegroups.com.

Reply via email to