# apt: upgrade=\[safe|full|dist\] seems to ignore "default\_release" parameter

**URL:** <https://forum.ansible.com/t/apt-upgrade-safe-full-dist-seems-to-ignore-default-release-parameter/15073>\
**Category:** Ansible Project\
**Created:** [April 23, 2014, 9:37am UTC](https://forum.ansible.com/t/apt-upgrade-safe-full-dist-seems-to-ignore-default-release-parameter/15073 "2014-04-23T09:37:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralph](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@Ralph](https://forum.ansible.com/u/Ralph)\
**Post date:** [April 23, 2014, 9:37am UTC](https://forum.ansible.com/t/apt-upgrade-safe-full-dist-seems-to-ignore-default-release-parameter/15073/1 "2014-04-23T09:37:55Z")

</div>

Hello everybody!

Here’s the thing! I add the Wheezy Backports repo to a newly provisioned VPS and want to do a safe-upgrade before doing anything else. My corresponding lines in the playbook look like this:

- name: Add Wheezy Backports  
apt\_repository: repo=‘deb [http://ftp.us.debian.org/debian](http://ftp.us.debian.org/debian) wheezy-backports main’ state=present update\_cache=yes  
tags:

- init

- name: Initial safe-upgrade of the system (from wheezy-backports)  
apt: upgrade=safe default\_release=wheezy-backports update\_cache=yes  
tags:

- init

Originally run on Ansible 1.5.4. Same on 1.5.5. At this point python-apt, apt-get and aptitude are installed. Playbook is run under root-user.

From where I’m standing, this should translate to “aptitude safe-upgrade -t wheezy-backports”. But it doesn’t seem to include the backports! Or I’m missing something! Same goes for apt: upgrade yes, full, or dist. If I’m ssh’ing to the box and running “aptitude safe-upgrade -t wheezy-backports” I’m getting quite a few upgardable packages…

Thanks in advance!

Cheers  
Ralph

---

<div class="post-metadata">

**Author:** ![Ralph](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@Ralph](https://forum.ansible.com/u/Ralph)\
**Post date:** [April 25, 2014, 8:25am UTC](https://forum.ansible.com/t/apt-upgrade-safe-full-dist-seems-to-ignore-default-release-parameter/15073/2 "2014-04-25T08:25:35Z")

</div>

Anybody able to confirm this pretty please? I also tried:

- name: Initial safe-upgrade of the system (from wheezy-backports)  
apt: upgrade=safe default\_release=wheezy-backports update\_cache=yes **state=latest**

No matter what I keep getting the “OK” (as if there’s nothing to do), whereas the a manual _aptitude safe-upgrade -t wheezy-backports_ gives me 17-ish upgradable packages.

Thanks a ton.  
Ralph

---

<div class="post-metadata">

**Author:** ![Ralph](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@Ralph](https://forum.ansible.com/u/Ralph)\
**Post date:** [May 1, 2014, 9:48pm UTC](https://forum.ansible.com/t/apt-upgrade-safe-full-dist-seems-to-ignore-default-release-parameter/15073/3 "2014-05-01T21:48:17Z")

</div>

Really? No one?

I switched to current HEAD, same thing… Would appreciate some comment on this.

Ralph

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 1, 2014, 10:16pm UTC](https://forum.ansible.com/t/apt-upgrade-safe-full-dist-seems-to-ignore-default-release-parameter/15073/4 "2014-05-01T22:16:29Z")

</div>

Silence on the mailing list usually means no one has a similar configuration and is able to reproduce what you are seeing.

Here’s the update code if you would like to trace what commands are being called on your end

[https://github.com/ansible/ansible/blob/devel/library/packaging/apt#L370](https://github.com/ansible/ansible/blob/devel/library/packaging/apt#L370)

More investigation should be somewhat helpful.

You can check out ansible on a remote machine and use ./hacking/test-module from the checkout to run the module, if you’d like to insert debug code to trace the update function.

---

<div class="post-metadata">

**Author:** ![Ralph](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@Ralph](https://forum.ansible.com/u/Ralph)\
**Post date:** [May 2, 2014, 4:26pm UTC](https://forum.ansible.com/t/apt-upgrade-safe-full-dist-seems-to-ignore-default-release-parameter/15073/5 "2014-05-02T16:26:40Z")

</div>

Thanks for answering Michael.

I took a peek at the code and compared to the signature of the install function (which uses the _default\_release_ option), this is not implemented in the upgrade function. So yeah, no check for _default\_release, no “-t \<alternative\_repo\>”. Should I go ahead and put this on the issue tracker?_

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 2, 2014, 7:11pm UTC](https://forum.ansible.com/t/apt-upgrade-safe-full-dist-seems-to-ignore-default-release-parameter/15073/6 "2014-05-02T19:11:33Z")

</div>

Yes please, that would be great.

Thanks!
