rvm/rvm1-ansible — pull request #22 by mrcrilly (2014-11-23 19:04:38+00:00)
Title: Allow --user-install symlinking

When using a user install, the symbolic links will usually be skipped. This means Bundler, as well as the other gems being installed by this role, aren't accessible from a shell script uploaded and executed by Ansible. Here is a very simple, example shell script, followed by the Playbook uploading it, and the Playbook wrapping all of these efforts:

*Bundle install our project requirements*:
```bash
#!/bin/bash
bundle install
```

*The Playbook uploading and executing the above*:
```yaml
---
- name: Upload our Gemfile
copy: src=Gemfile dest=/home/vagrant/
- name: Run our script
script: bundle_install.sh
```

*The "site.yml" Playbook implementing the above*:
```yaml
---
- hosts: all
sudo: no
vars:
rvm1_install_path: '/home/vagrant/.rvm'
rvm1_install_flags: '--auto-dotfiles --user-install'
rvm1_rvm_check_for_updates: False
rvm1_symlink_to: '/home/vagrant/.rvm/bin'
rvm1_symlink_user: 'vagrant'
rvm1_symlink_group: 'vagrant'
roles:
- rvm_io.rvm1-ruby
- rubyproject
```

("rubyproject" just being a dummy project with a Gemfile)

When attempting to execute the Bash script, it was unable to find Bundler. This is because the symbolic link in '/usr/local/bin/' does not exist at this point. With the changes I have implemented in this PR, the symbolic links are created in the user's home directory, under '.rvm/bin', making the core gems (Bundler, etc) available from the shell and from shell scripts. The shell script can now execute, finds Bundler, and successfully installs my gems.