Re: [ansible-project] Loading rvm in remote server before a playbook starts
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/20150823112904.GA39396%40HM-MFRANKE1.fritz.box. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Coming two lists into one
I'm having a very simple requirement but I have a tough time to make it work Basically I have a list like this: MACHINES: [ { name: Test1, ip: 192.168.1.100}, { name: Test2, ip: 192.168.1.101}, ] I then query AWS to get a list of machines back in a registered variable. What I want to do is to loop over this this registered variable to get InstanceID for any matching host with my MACHINES, then tag it with the Name in MACHINES. Can anyone advise on how I can achieve this? Thanks, Stanley -- 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/0a11a8c8-0cfb-43b2-8f89-a30cfff6ec94%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Question / Confusion re: Variables
Hey -- was hoping somebody could explain to me what is going on here. *group_vars/all:* db_name: top_level_db *roles/role_name/vars/main.yml:* db_name: role_level_db db_name_test: {{db_name}} env: DB_NAME: {{db_name}} When I run code in roles/role_name/tasks/main.yml, when I try to use the variables, I see that db_name_test is as I expect (it returns the value role_level_db), but the env.DB_NAME value is surprising to me (it shows top_level_db) Any comments/clarification are appreciated! Thanks Brian -- 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/8d60f5ef-e225-437b-b348-1124f4a03c81%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Replace variable w/ jinja2
moustaches don't stack: set_fact: deploy_list{{ item | replace('deploylist/' + jira_ticket + '/', '') }} -- 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/CAJ5XC8nBVQ2Z6OMiDjs3Ly7Dj3FE2qP6B-aU%2B2%2BBN6dX%2BW9r4A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Loading rvm in remote server before a playbook starts
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.