4

我有成功安装 rvm 的 ansible-playbook。但现在我必须更改默认的 ruby​​ 版本。我尝试过:

- name: Install Bundler
  command: bash -lc "rvm use 2.1.2-p95"

或者

- name: use 2.1
  shell: /usr/bin/env bash -lc "rvm use 2.1.2-p95"

或者

- name: use 2.1
  shell: rvm use 2.1.2-p95

但是没有任何 ansible 看起来一切正常,但是当我使用相同的用户登录 ssh 并使用 ansible 并运行rvm currentruby​​ 版本时是相同的。

我怀疑来自 ssh 和 bash 登录 shell,但我可以看到解决方案。

4

1 回答 1

8

尝试:

- name: Install Bundler
  command: rvm alias create default ruby-2.1.2-p95

顺便提一句。你见过 RVM 对 Ansible 的支持吗:https ://github.com/rvm/rvm1-ansible

于 2014-10-14T21:40:17.990 回答