# Module update\_alternatives for Debian/Ubuntu

**URL:** <https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 31, 2012, 8:54am UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056 "2012-10-31T08:54:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philipp\_Grau](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@Philipp\_Grau](https://forum.ansible.com/u/Philipp_Grau)\
**Post date:** [October 31, 2012, 8:54am UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/1 "2012-10-31T08:54:21Z")

</div>

Hello,

to get my feet wet with ansible I wrote a small module that handles the  
update-alternative command  
([http://www.debian-administration.org/articles/91](http://www.debian-administration.org/articles/91)) on Debian/Ubuntu systems.  
It is about setting the default application for awk (gwak|nawk|mawk) or  
x-browser and stuff like that. Even handling of diffrent java installations  
is possible.

It's small and simple but "works for me"(tm). You can have a look here:

[https://github.com/phgrau/ansible-stuff](https://github.com/phgrau/ansible-stuff)

Feedback is welcome.

Kind regards,

Philipp

---

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [June 16, 2013, 7:54pm UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/2 "2013-06-16T19:54:15Z")

</div>

Hi Phillip:

Just today, I had a need for this module on Ubuntu, and I was very happy to discover that it existed already. I’ve tested it out, and it works for me as well. Could you contribute this to the upstream ansible project?

Lorin

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [June 17, 2013, 1:33am UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/3 "2013-06-17T01:33:54Z")

</div>

And my todo list just got shortened, awesome thanks!

Just send a pull request to the ansible project to get it merged into core.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 17, 2013, 3:46am UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/4 "2013-06-17T03:46:41Z")

</div>

Alternatives is also a Red Hat thing, so you might want to also check it there to see if there are any differences.

–Michael

---

<div class="post-metadata">

**Author:** ![Ali-Akber\_Saifee](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@Ali-Akber\_Saifee](https://forum.ansible.com/u/Ali-Akber_Saifee)\
**Post date:** [August 12, 2013, 3:15am UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/5 "2013-08-12T03:15:44Z")

</div>

Hi,  
Was there any progress on bringing this module into ansible core? If not, is there anything I can do to help? (I’d like to use the module and would rather not copy/paste)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [August 12, 2013, 9:09pm UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/6 "2013-08-12T21:09:49Z")

</div>

I don’t recall seeing a pull request, but I could be misremembering.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [August 12, 2013, 9:26pm UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/7 "2013-08-12T21:26:59Z")

</div>

one was rejected, i put on my list to ‘fix it up for acceptance’ but haven’t gotten around to it yet.

---

<div class="post-metadata">

**Author:** ![Ben\_Turner](https://avatars.discourse-cdn.com/v4/letter/b/77aa72/32.png) [@Ben\_Turner](https://forum.ansible.com/u/Ben_Turner)\
**Post date:** [February 28, 2014, 12:12am UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/8 "2014-02-28T00:12:23Z")

</div>

Keen to see this in Ansible Core too - does anyone have a link to any previous pull request ?

---

<div class="post-metadata">

**Author:** ![Ernest0x](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Ernest0x](https://forum.ansible.com/u/Ernest0x)\
**Post date:** [February 28, 2014, 9:10am UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/9 "2014-02-28T09:10:34Z")

</div>

If you don’t need this task to be idempotent, you can use something like this:

---

<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:** [February 28, 2014, 2:05pm UTC](https://forum.ansible.com/t/module-update-alternatives-for-debian-ubuntu/12056/10 "2014-02-28T14:05:12Z")

</div>

Yep, that command won’t hurt anything so it would be fine to run that way.
