Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it is posible to install multiple ruby versions?? #35

Closed
blackjid opened this issue Mar 9, 2015 · 17 comments
Closed

it is posible to install multiple ruby versions?? #35

blackjid opened this issue Mar 9, 2015 · 17 comments

Comments

@blackjid
Copy link

blackjid commented Mar 9, 2015

something like this

rbenv:
  rbenv_versions: 
  - 2.0.0-p538
  - 2.1.0
@zzet
Copy link
Owner

zzet commented Mar 9, 2015

Hi @blackjid! At this moment no. Until April, I will not have time to add this functionality.

@blackjid
Copy link
Author

blackjid commented Mar 9, 2015

I'd be happy to make a PR...
could you please point me in the right direction???
what should be the definitions??

- role: zzet.rbenv
      rbenv_users:
        - deploy
      ruby_versions: 
        - 2.0.0-p643
        - 2.1.2
      ruby_global_version: 2.0.0-p643

something like that?

@zzet
Copy link
Owner

zzet commented Mar 9, 2015

If we talk about users and the version of Ruby - then we have a matrix:

      rbenv_users:
        - deploy
        - other
      ruby_versions: 
        - 2.0.0-p643
        - 2.1.2

for deploy and other user will installed all ruby versions from list. I think this is not correct.
It is better for each user to specify which version to put:

like as

- rbenv_install:
  - user: deploy
    versions:
      - 2.0.0-p643
      - 2.1.2

or as hash

{ rbenv_install: [
    { user: deploy, versions: [2.0.0-p643, 2.1.2] },
    { user: other, versions: [2.1.2] }
]}

I need to take a break and think about how best to do this. We should bear in mind that this is a rare case and role overload is not necessary. Most users will want to install 1 ruby version for 1 or more users. If we say that we need to put more than one version, you should talk about what you need or different users on different versions of one or several versions, but at the same time indicate which of them is used by default. For example last defined in versions list, or specify version as key

- rbenv_install:
  - user: deploy
    versions:
      - 2.0.0-p643
      - 2.1.2
    default:
      - 2.0.0-p643

In addition, changes in key version may be a surprise to those who already use role. After these changes will be released major version.

@zzet
Copy link
Owner

zzet commented Mar 9, 2015

@blackjid If you have any thoughts on this issue - I will be glad to consider them

@zzet
Copy link
Owner

zzet commented Mar 11, 2015

Hi @blackjid!

I think this definitions is good (based on default settings):

rbenv:
  env: system
  version: v0.4.0
  ruby_version: 2.2.0 # For system install only

# ....

rbenv_install:
  - user: deploy
    ruby_versions:
      - 2.0.0-p643
      - 2.1.2
    default: 2.0.0-p643

  - user: other
    ruby_versions:
      - 2.2.0
      - 2.1.2
    default: 2.2.0

  - user: old
    ruby_versions:
      - 1.9.3
    default: 1.9.3

# or 
# rbenv_install: 
#   - { user: deploy, ruby_versions: [2.0.0-p643, 2.1.2], default: 2.0.0-p643 }
#   - { user: other,  ruby_versions: [2.2.0, 2.1.2],      default: 2.2.0 }
#   - { user: other,  ruby_versions: [1.9.3],             default: 1.9.3 }

What do you think about it?

@blackjid
Copy link
Author

I like it,
looks very good, very clear and all the use cases I can think of are there.

@zzet
Copy link
Owner

zzet commented Mar 11, 2015

@blackjid you are planning to prepare PR?

@blackjid
Copy link
Author

mm, here is the thing... I offered to create a PR... i know... but I ended up creating a role specific for my use case.... why? I don't need some of the feature of this role, such as multi-user installations, but I need other features besides multiple-rubies such as aliases and per ruby gem installations

The thing is that I'd be happy to provide a PR, but i'm not in a hurry now, (I was when I opened the issue)

@zzet
Copy link
Owner

zzet commented Mar 11, 2015

What do you mean about aliases? (you can open separated issues for discussion of this features, this issue only for multiple-rubies installation)

@pcriv
Copy link

pcriv commented Mar 25, 2015

Hey @blackjid @zzet i also had to create my own role to support multiple rubies.. https://github.com/pablocrivella/ansible-role-rbenv
My approach is different tho, also i tried to organize tasks on a pretty way 😅
Maybe we could merge the bests parts of each role into this one since it's the most used by the community.

@zzet
Copy link
Owner

zzet commented Mar 25, 2015

Hi @pablocrivella . You can send pull request.

@UnderGreen
Copy link
Contributor

I can implement this FR on weekend

@zzet
Copy link
Owner

zzet commented Apr 20, 2015

@UnderGreen it's cool

@zzet
Copy link
Owner

zzet commented May 8, 2015

Hi @UnderGreen . Do you plan implement this FR?

@TomNaessens
Copy link

👍

@jufemaiz
Copy link

Any movement on this?

@zzet
Copy link
Owner

zzet commented Dec 22, 2016

done

@zzet zzet closed this as completed Dec 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants