我有成功安装 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 current
ruby 版本时是相同的。
我怀疑来自 ssh 和 bash 登录 shell,但我可以看到解决方案。