8000 Please provide more examples? · Issue #89 · zzet/rbenv · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Please provide more examples? #89

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

Open
sbwoodside opened this issue Jan 18, 2017 · 3 comments
Open

Please provide more examples? #89

sbwoodside opened this issue Jan 18, 2017 · 3 comments

Comments

@sbwoodside
Copy link

Can you provide some more examples? For example, how do I simply install a specific version of ruby system-wide? I tried this and got an error:

- hosts: whatever
  vars:
    rbenv:
      default_ruby: 2.3.1
      rubies:
      - version: 2.3.1
      
  roles:
    - role: zzet.rbenv

Result:

TASK [zzet.rbenv : include env vars] *******************************************
fatal: [monitor.medstack.net]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'dict object' has no attribute 'env'\n\nThe error appears to have been in '/Users/simon/sandbox/medstack/deployment/ansible/galaxy/zzet.rbenv/tasks/main.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: include env vars\n ^ here\n"}

Examples for other common configurations would also be welcome.

@sdejean
Copy link
sdejean commented Feb 2, 2017

@sbwoodside I think the answer you need is in the example from the README:

- hosts: web
  gather_facts: true # https://github.com/zzet/ansible-rbenv-role/issues/37
  vars:
    rbenv:
      env: user
      version: v0.4.0
      default_ruby: 2.0.0-p353
      rubies:
      - version: 2.0.0-p353

Your error is The error was: 'dict object' has no attribute 'env', meaning that you need to add the env property to your dictionary. You should also specify the version property in that dictionary to tell the role which version of rbenv to install. Ansible does not merge dictionary values by default, so once you specify one property of that dictionary, you need to specify all of them.

@sbwoodside
Copy link
Author

Ansible does not merge dictionary values by default, so once you specify one property of that dictionary, you need to specify all of them.

Ahh, I didn't understand that. Thanks. Might be worth including that in the README, unless its obvious to most ansible users.

@ghg
Copy link
ghg commented Mar 31, 2017

I don't think this is obvious either. I spent quite a bit of time today trying to figure this out also until I checked this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0