Boto is required on the host it runs on. There is no way to execute boto specific things on "test" when it is only installed on local host.
What you can do is something like collect information on "test" then run boto stuff on "localhost". /martin On Sat 6 Jun 2015 at 05:53 David Pires <[email protected]> wrote: > Setting the interpreter for the remote host would require boto being > installed on the remote host, which isn't what I'm after. > > Setting the variable on localhost and accessing it remotely using hostvars > does work, however, the real issue is how ansible can't seem to find boto > when its run inside a virtualenv for a remote host task. > > > > On Friday, June 5, 2015 at 11:26:07 PM UTC-4, Matt Martz wrote: > >> So set ansible_python_interpreter to the correct Python binary for the >> virtualenv on the remote host. >> >> Also, you can execute tasks on localhost and then reference it from >> another host: >> >> >> http://docs.ansible.com/playbooks_variables.html#magic-variables-and-how-to-access-information-about-other-hosts >> >> Or use local_action which will delegate to localhost, but register the >> car to the remote host. >> >> On Friday, June 5, 2015, David Pires <[email protected]> wrote: >> >>> --- >>>> - hosts: remote_host >>>> pre_tasks: >>>> - name: Read host >>>> connection: local >>>> route53: >>>> command: get >>>> zone: ZONE >>>> record: RECORD >>>> type: A >>>> register: host_record >>>> roles: >>>> - test >>> >>> >>> When boto/ansible is available globally, this playbook works as >>> expected, it registers the variable and can be used on a remote host. >>> >>> This does not work when boto/ansible is being used inside a virtualenv. >>> Boto can not be found. >>> >>> What seems to be the issue, is ansible is using the global python >>> version (which doesn't have boto) when using remote hosts. >>> >>> When inside the virtualenv and setting python_interpreter for localhost, >>> these tasks work on localhost. >>> >>> >>> On Friday, June 5, 2015 at 11:01:47 PM UTC-4, Brian Coca wrote: >>>> >>>> I'm confused, what you are stating seems to contradict itself. >>>> >>> -- >>> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/ansible-project/efabc0bd-0952-4830-9105-bc56ac2f6d39%40googlegroups.com >>> <https://groups.google.com/d/msgid/ansible-project/efabc0bd-0952-4830-9105-bc56ac2f6d39%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> -- >> Matt Martz >> @sivel >> sivel.net >> >> -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/f7823de7-dcba-40c5-8c6b-9cefd50a73eb%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/f7823de7-dcba-40c5-8c6b-9cefd50a73eb%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- -- http://www.xing.com/profile/Martin_Marcher http://www.linkedin.com/in/martinmarcher Mobil: +43 / 660 / 62 45 103 UID: ATU68801424 -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAK1mKESFfi-xU%2BGw2BxX-595J0PJ4%3DRMLcQ5fhD0%3DVQPjr6o0g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
