rvm / rvm1-ansible

The official ansible RVM role to install and manage your Ruby versions.
MIT License
271 stars 136 forks source link

ansible not setting the default #106

Closed rjrobinson closed 7 years ago

rjrobinson commented 7 years ago

I thought this installed correctly but, apparently, no default ruby is being set. I get no fails on install, and I have even started over with a fresh VM.

/setup.yml

---
- hosts: alpha-sandbox
  become: true
  roles:
    - { role: rvm_io.rvm1-ruby,
        tags: ruby,
        rvm1_rubies: 'ruby-2.2.5',
        rvm1_install_flags: '--auto-dotfiles --user-install',
        rvm1_install_path: '/home/{{ ansible_ssh_user }}/.rvm',
      }

the bigger issue, thinking that this worked, my production env is kinda stalled. Am I missing something?

viruzzo commented 7 years ago

rvm1_rubies is a list, so you must define it as such: rvm1_rubies: [ 'ruby-2.2.5' ]. I stumbled upon the same problem.

rjrobinson commented 7 years ago

@viruzzo , THANK YOU. That was totally the reason.

however, even with the auto dotfiles flag im till getting this error

Warning: PATH set to RVM ruby but GEM_HOME and/or GEM_PATH not set, see:
    https://github.com/rvm/rvm/issues/3212

Hint: To fix PATH errors try using 'rvmsudo' instead of 'sudo', see:
    https://stackoverflow.com/questions/27784961/received-warning-message-path-set-to-rvm-after-updating-ruby-version-using-rvm/28080063#28080063

Warning! PATH is not properly set up, $GEM_HOME is not set,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.2.5'.
viruzzo commented 7 years ago

I have a doubt wheter is it legal to specify become at the root level; can you try specifying it at the role level, i.e.: - { role: rvm_io.rvm1-ruby, ..., become: True }?

lpaulmp commented 7 years ago

By default rvm is installing as a root, I thinks this setup is no the most secure, because root should have just the tools/binaries that it uses no less and no more, that creates a secure environment, I see in so many cases where the user root is not accessible. I'll try to patch that soon.

lpaulmp commented 7 years ago

I opened the issue https://github.com/rvm/rvm1-ansible/issues/113 related with this thread , but in this case @rjrobinson missed rvm1_user: foo.

lpaulmp commented 7 years ago

I'm closing this one since it was addressed.