Oddity with alternatives module in Ansible 1.9.4?

40 views
Skip to first unread message

H. Wade Minter

unread,
Jan 3, 2016, 11:48:06 PM1/3/16
to Ansible Project
Hi all,

I was trying to use the alternatives module to set up a new version of Ruby with Ansible 1.9.4 (both ends), and ran into problems. 

I used the apt module to uninstall Ruby 2.1 and to install Ruby 2.2. Then, I wanted to make sure that 2.2 was the default for /usr/bin/ruby, /usr/bin/gem, and /usr/bin/rake. However, the alternatives symlinks don't seem to get created.

Here's an example of an ad-hoc command I'm running:

23:41 $ ansible 'tag_Stages_preproduction:&tag_app_true' -m alternatives -a 'name=ruby path=/usr/bin/ruby2.2 link=/usr/bin/ruby' --sudo

52.91.69.251 | success >> {

    "changed": false

}


But if I go to that server and look, /usr/bin/ruby isn't there.


Wades-WeaveUp-Mac:~ minter$ ssh 52.91.69.251 ls /usr/bin/ruby

ls: cannot access /usr/bin/ruby: No such file or directory


If I run the update-alternatives command that I think the module does by hand, it does work.


root@preprod-app01:~# update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby2.2 0

root@preprod-app01:~# /usr/bin/ruby --version

ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux-gnu]


Am I missing something here?


--Wade

Toshio Kuratomi

unread,
Jan 5, 2016, 9:40:37 AM1/5/16
to ansible...@googlegroups.com

What operating system are you running on your target system?

-Toshio

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c7a0516c-3cdf-48fe-9f81-50d77fe588d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

H. Wade Minter

unread,
Jan 5, 2016, 9:56:18 AM1/5/16
to Ansible Project
The target OS is Ubuntu 14.04.

Thanks,
Wade
Reply all
Reply to author
Forward
0 new messages