I'd like to run the apt-get --fix-broken install
command in Ansible. It doesn't work if I use command: apt-get -f install
, and the apt
module doesn't appear to provide a parameter for specifying that option. How can I do it in Ansible?
The apt module manages system packages on Debian-based operating systems such as Ubuntu, the distribution we're using on remote nodes throughout this guide. The following playbook will update the apt cache and then make sure Vim is installed on remote nodes.
You can use the DNF module to manage the actual installation and a YAML-based Ansible playbook to distribute the installation instructions to your managed nodes.
Codifying my (apparently helpful) answer from the comments:
Try adding -y
to the command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With