I am trying to upgrade all our (ubuntu) servers with the following playbook:
- hosts: all
serial: 2
tasks:
- name: apt-get update
apt: update_cache=yes
- name: apt-get dist-upgrade
apt: upgrade=dist dpkg_options='force-confold,force-confdef'
- name: reboot
command: '/sbin/reboot'
This fails like so:
TASK: [apt-get dist-upgrade] **************************************************
<10.0.20.4> REMOTE_MODULE apt upgrade=dist dpkg_options='force-confold,force-confdef'
<10.0.20.67> REMOTE_MODULE apt upgrade=dist dpkg_options='force-confold,force-confdef'
failed: [10.0.20.4] => {"cmd": ["DEBIAN_FRONTEND=noninteractive", "DEBIAN_PRIORITY=critical", "/usr/bin/apt-get", "-y", "-o", "Dpkg::Options::=--force-confold", "-o", "Dpkg::Options::=--force-confdef", "dist-upgrade"], "failed": true, "rc": 2}
msg: [Errno 2] No such file or directory
The command runs fine if I run it as root on the machine itself:
'DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical /usr/bin/apt-get -y -o Dpkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef dist-upgrade'
Using that command line in a ansible 'command' or 'shell' statement instead of the apt command produces exactly the same error.
Any ideas?
cheers
Jens-Christian