Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using "apt-get -f install" In Ansible

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?

like image 242
CherryBelle Avatar asked Sep 02 '16 09:09

CherryBelle


People also ask

What is apt in Ansible playbook?

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.

Which module is used to install a package in Ansible?

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.


1 Answers

Codifying my (apparently helpful) answer from the comments:

Try adding -y to the command.

like image 180
mwp Avatar answered Oct 11 '22 22:10

mwp