I'm trying to install ruby from source and am using the template to export the path. This is my yaml file:
- name: clone rbenv
git: repo=git://github.com/sstephenson/rbenv.git dest=/usr/local/rbenv
become: yes
- template: src=templates/rbenv.sh.j2 dest=/etc/profile.d/rbenv.sh
become: true
- name: clone ruby-build repo
git: repo=git://github.com/sstephenson/ruby-build.git dest=~/ruby-build
- name: Install ruby-build
shell: ./ruby-build/install.sh
become: yes
- name: install jruby
shell: . /etc/profile.d/rbenv.sh && rbenv install jruby-9.0.5.0
become: yes
This playbook runs successfully but here I need to source profile with every command. I there any way I could set the source profile once in ansible.config file or any other way at all to achieve this without having to source it with every command.