'm receiving an error when trying to install compass using a playbook (on an AWS EC2 instance)
curl -L https://get.rvm.io | bash -s stable
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
gem install compass
I've tried converting this to script to the following playbook -
---
- hosts: "{{ host_name }}"
become: yes
become_user : deploy3
tasks:
- name: get gpg
shell: "gpg --keyserver hkp://
keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3"
- name: install rvm
- name: install rvm 2.1.2
shell: "/home/deploy2/.rvm/bin/rvm install 2.1.2"
- name: use rvm 2.1.2 by default and install compass
shell: "bash -lc \"/home/deploy2/.rvm/bin/rvm use 2.1.2 --default && /usr/bin/gem install compass\""
...
deploy is not a sudoer, but when I try to install compass manually it succeeds, and as a playbook I receive the following error - You don't have write permissions into the /var/lib/gems/1.9.1 directory.
Has anyone encountered this issue and prevailed?