# Module apt pass dpkg options

**URL:** <https://forum.ansible.com/t/module-apt-pass-dpkg-options/13368>\
**Category:** Ansible Project\
**Created:** [August 26, 2013, 10:03pm UTC](https://forum.ansible.com/t/module-apt-pass-dpkg-options/13368 "2013-08-26T22:03:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rumen\_Telbizov](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@Rumen\_Telbizov](https://forum.ansible.com/u/Rumen_Telbizov)\
**Post date:** [August 26, 2013, 10:03pm UTC](https://forum.ansible.com/t/module-apt-pass-dpkg-options/13368/1 "2013-08-26T22:03:14Z")

</div>

Hello everyone,

I have a quick question/request.  
I have just finished rewriting a shell script which was used to

upgrade a given piece of software. Now it’s ansible playbook!

The one piece of functionality that I can’t find and need is to be  
able to pass options to the apt-get command and more precisely

the DPkg::Options::

In particular I need to give it the option: “–force-confnew”

The script current does something like this:

apt-get --allow-unauthenticated -o DPkg::Options::=“–force-confnew” install packagename

So is there any way I can pass the -o DPkg::Options::=“–force-confnew” part to the  
apt module the way it is right now?

It would be nice to have something like dpkg\_options=“” in the apt module and or only options=“” for things like the --allow-unauthenticated.

Thanks,

---

<div class="post-metadata">

**Author:** ![Rumen\_Telbizov](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@Rumen\_Telbizov](https://forum.ansible.com/u/Rumen_Telbizov)\
**Post date:** [August 27, 2013, 12:49am UTC](https://forum.ansible.com/t/module-apt-pass-dpkg-options/13368/2 "2013-08-27T00:49:39Z")

</div>

It seems like currently the apt ansible module hard-codes the following:

```auto
DPKG_OPTIONS = '-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"'

Does it sound reasonable to have a "dpkg_options" parameter which will override the above if present?

The documentation should mention the default ones and say that if specified explicitly it will 
completely overwrite them.

```

```auto
Cheers,

```

```auto

```

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [August 27, 2013, 12:53am UTC](https://forum.ansible.com/t/module-apt-pass-dpkg-options/13368/3 "2013-08-27T00:53:07Z")

</div>

Go ahead and open up a github issue for this, and we’ll consider it.

Thanks!

---

<div class="post-metadata">

**Author:** ![Rumen\_Telbizov](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@Rumen\_Telbizov](https://forum.ansible.com/u/Rumen_Telbizov)\
**Post date:** [August 27, 2013, 8:08pm UTC](https://forum.ansible.com/t/module-apt-pass-dpkg-options/13368/4 "2013-08-27T20:08:47Z")

</div>

Thank you James. Appreciated!

I submitted issue [https://github.com/ansible/ansible/issues/3955](https://github.com/ansible/ansible/issues/3955) for this.

Regards,

Rumen Telbizov
