简体   繁体   English

用ansible playbook改变rvm ruby​​版本

[英]change rvm ruby version with ansible playbook

I have ansible-playbook succesfully installing rvm. 我有ansible-playbook成功安装rvm。 But now i must change default ruby version. 但现在我必须更改默认的ruby版本。 I have tried with: 我尝试过:

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

or 要么

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

or 要么

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

But nothing ansible looks like all works fine but when i log ssh with the same user wich use ansible and run rvm current the ruby version is the same. 但是没有任何ansible看起来一切正常但是当我使用相同的用户登录ssh时使用rvm current并运行rvm current ,ruby版本是相同的。

I suspect from ssh and bash login shell but I can see solution. 我怀疑从ssh和bash登录shell但我可以看到解决方案。

try: 尝试:

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

btw. 顺便说一句。 have you seen RVMs support for Ansible: https://github.com/rvm/rvm1-ansible 你有没有看到RVM支持Ansible: https//github.com/rvm/rvm1-ansible

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM