Saturday, January 8, 2022

[SOLVED] how to deal with unverified apt install in ansible

Issue

when installing an apt package from our own repo, I get the the following on the CLI:

Install these packages without verification? [y/N]

The question is, how does one install these packages successfully using ansible?

Even with the force option, ansible fails to install the package.

The command I'm using is:

- apt: name=coupons-graphite dpkg_options='force' state=present

Solution

According to the documentation for the apt module you should be using force=yes in this case:

- apt: name=coupons-graphite
       state=present
       force=yes


Answered By - Bruce P