Re: [ansible-project] Loading rvm in remote server before a playbook starts

2015-08-23 Thread Derrick Mar
I see thanks Marcus. I'll go ahead keep fiddling with this and see what I 
come up with.

On Sunday, August 23, 2015 at 4:29:16 AM UTC-7, Marcus Franke wrote:
>
> On Sat, Aug 22, 2015 at 03:15:40PM -0700, Derrick Mar wrote: 
> > Hey Brian. Thanks for the response. Yeah I definitely agree this is a 
> noop. 
> > My question is how do I make is so that it loads RVM and 
> ansible_env.PATH 
> >  will include paths such as  /home/ubuntu/.rvm/gems/ruby-2.2.2/wrappers. 
> For 
> > example, immediately when I SSH into my EC2 instance it automatically 
> loads 
> > RVM. I'd like to do the same with ansible when I ssh. 
> > 
>
> Hi, 
>
> the problem with this is, that you are loading your .rvm environment 
> probably 
> from some kind of .profile or the login shell you are using. 
>
> When Ansible does its login into the destination server it is running in 
> an 
> empty environment like a cron job. 
>
> You have to wrap your script in a wrapper script, that would enable your 
> rvm 
> environment inside your task. Maybe you should reconsider using a ruby 
> version 
> from rvm for system tasks, you may be trying to perform. 
>
>
> Greetings, 
> /mf 
>
> -- 
> may you always grok in fullness 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e2415316-1f5d-42db-b8cd-ee65c65dab4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Loading rvm in remote server before a playbook starts

2015-08-22 Thread Derrick Mar
Hey Brian. Thanks for the response. Yeah I definitely agree this is a noop. 
My question is how do I make is so that it loads RVM and ansible_env.PATH 
 will include paths such as  /home/ubuntu/.rvm/gems/ruby-2.2.2/wrappers. For 
example, immediately when I SSH into my EC2 instance it automatically loads 
RVM. I'd like to do the same with ansible when I ssh.

On Thursday, August 20, 2015 at 7:34:58 PM UTC-7, Brian Coca wrote:
>
> >- name: Deploy my app 
> >  environment: 
> >PATH: "{{ ansible_env.PATH }} 
>
> This is basically a noop, you are assigning the PATH ansible normally 
> gets to the PATH, also environment is not a task, it is a play/task 
> directive. 
>
>
>
> -- 
> Brian Coca 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/934dba75-5aa3-4ec3-afb6-14885b9258c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] msg: [Errno 2] No such file or directory when using bundle

2015-08-19 Thread Derrick Mar
Hello Ansible community!

I'm just getting started with Ansible, and seem to be not understanding why 
this happens.

My playbook
- name: bundle install
  command: "bundle install"
  args:
chdir: "~/ai_grading_production/"

I get the error msg: [Errno 2] No such file or directory when using bundle

When I actually specify the full path it works
command: "/home/ubuntu/.rvm/gems/ruby-2.2.2/wrappers/bundle install"

When I use the shell module it error with this message
stderr: /bin/sh: 1: bundle: not found

Does anyone know why I have to specify the full path to use the bundle 
command. And how can I fix? Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/da5943e1-1606-4f50-91f8-fd2051882a66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Loading rvm in remote server before a playbook starts

2015-08-19 Thread Derrick Mar
Hello! Does anyone know how to load rvm in a playbook so that it's 
available in {{ ansible_env.PATH }} ? 

- name: Deploy my app
  environment:
PATH: "{{ ansible_env.PATH }}

This does not include /home/ubuntu/.rvm/gems/ruby-2.2.2/wrappers

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cc3da9c2-252a-4fac-b59e-ecc1f26b62e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.