# Trouble updating alternatives on CentOS via shell/command modules

**URL:** <https://forum.ansible.com/t/trouble-updating-alternatives-on-centos-via-shell-command-modules/15892>\
**Category:** Ansible Project\
**Created:** [August 8, 2014, 3:58pm UTC](https://forum.ansible.com/t/trouble-updating-alternatives-on-centos-via-shell-command-modules/15892 "2014-08-08T15:58:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_Malouf](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@Gary\_Malouf](https://forum.ansible.com/u/Gary_Malouf)\
**Post date:** [August 8, 2014, 3:58pm UTC](https://forum.ansible.com/t/trouble-updating-alternatives-on-centos-via-shell-command-modules/15892/1 "2014-08-08T15:58:16Z")

</div>

I tried using the debian-specific update-alternatives module but this did not work. Very simply, I have a command that when executed from the command line on the server itself works fine but via a task in our playbook says it succeeded but in reality has no effect.

Very simply, I am trying to do:

- name: “Use our version of java as default command”

shell: /usr/sbin/alternatives --set java /usr/local/java/bin/java

The playbook runs as root on the remote machine so I doubt it is a permissions issue - anyone else encounter this?

---

<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 8, 2014, 7:51pm UTC](https://forum.ansible.com/t/trouble-updating-alternatives-on-centos-via-shell-command-modules/15892/2 "2014-08-08T19:51:25Z")

</div>

alternatives module works for me, if it does not for you, could you file a bug?​
