I managed to fix this with these two tasks:
- name: Find the path to the python interpreter
command: which python
register: pythonpath
when: lookup('env', 'CI') == "true"
- name: Set python interpreter path when in CI
set_fact: ansible_python_interpreter={{ pythonpath.stdout }}
when: lookup('env', 'CI') == "true"
You would take out the when statements as they are specific to my testing
environment.
On Friday, August 2, 2013 at 9:52:32 AM UTC-5, Dan McKean wrote:
>
> I've been considering Ansible for creating our EC2 instances, and have run
> into a problem with ansible not finding boto from either the command line
> or a playbook.
>
> Here's the command line and response; the playbook is similar:
>
> ansible localhost -m ec2 -a "image=ami-0358ce33 instance_type=t1.micro
> keypair=myKeypairName group=default wait=true"
>
> localhost | FAILED >> {
> "failed": true,
> "msg": "boto required for this module"
> }
>
>
> I'm running Ansible from an activated virtualenv. Ansible was installed
> with pip install ansible, and boto's installed as well in the venv (as well
> as globally).
>
> If I activate the venv and open a command prompt, I can import boto
> without any problem, and a boto.connect_ec2() succeeds (there is a ~/.boto
> config file present). Importing ansible and creating a Runner works
> succeeds as well. I'm running this on Mac OS X.
>
> Any suggestions on how to fix this? Thanks!
>
> -- Dan
>
>
>
--
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/1b9f6946-442f-4da7-bfec-481608a007a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.