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:
("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.
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:
The Playbook uploading and executing the above:
The "site.yml" Playbook implementing the above:
("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.