Poking around I found this, could there be a relationship ?
├─sshd,14441
│ └─sh,14736 -c /usr/bin/python
/root/.ansible/tmp/ansible-tmp-1650945060.61-15873-131215080055549/AnsiballZ_apt.py
&& sleep 0
│ └─python,14737
/root/.ansible/tmp/ansible-tmp-1650945060.61-15873-131215080055549/AnsiballZ_apt.py
│ └─aptitude,15251 -y -o Dpkg::Options::=--force-confdef -o
Dpkg::Options::=--force-confold safe-upgrade
│ ├─aptitude,21329 -y -o
Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold
safe-upgrade
│ │ └─sh,21330 -c test -x
/usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true
│ │ └─frontend,21331 -w
/usr/share/debconf/frontend /usr/sbin/needrestart
│ │ └─(needrestart,21335)
│ └─{aptitude},15256
# /usr/sbin/needrestart
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by
another process: Resource temporarily unavailable
# lsof /var/cache/debconf/config.dat
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
frontend 21331 root 4uW REG 254,2 31187 131278
/var/cache/debconf/config.dat
A needrestart process is spawned but due to
/var/cache/debconf/config.dat locked by frontend it is unable to process.
Of course may be unrelated.