I maintain a flock of EC2 servers with ansible. The servers are regularly updates and upgraded using the apt module.
When I manually tried to upgrade a server, I received the following message:
$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: linux-headers-3.13.0-29 linux-headers-3.13.0-29-generic linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic linux-image-3.13.0-29-generic linux-image-3.13.0-32-generic Use 'apt-get autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Is there a way to run
sudo apt-get autoremove with ansible?