How to specify ansible user?

ssh-agent works fine for normal ssh. For instance, being careful not
to use use any ssh config (since from many prior mailing list queries
inheriting the full ssh config has been identified as
will-not-implement - seems worth mentioning in the docs BTW):

$ ssh -F /dev/null ubuntu@www.aws.slice-data.com echo hello
hello

But ansible cannot authenticate:

$ head /etc/ansible/hosts
www.aws.slice-data.com ansible_ssh_user=ubuntu
...

$ ansible www.* -m ping
www.aws.slice-data.com | FAILED => FAILED: Authentication failed.

When I try -c ssh, I am prompted to enter (which already is added to
my agent), but all my passphrase entries seem to be ignored/rejected.

$ ansible -c ssh www.* -m ping
Enter passphrase for key '/home/yang/sec/slice-west-2.pem':
Enter passphrase for key '/home/yang/sec/slice-west-2.pem':
Enter passphrase for key '/home/yang/sec/slice-west-2.pem':
www.aws.slice-data.com | FAILED => failed to transfer file to /ping:

Permission denied (publickey).
Couldn't read packet: Connection reset by peer

At this point I noticed that the docs say this is a feature for 1.1+
only. I'm using Ubuntu 12.04 and ansible 1.0 from the Ubuntu PPA
listed in http://ansible.cc/docs/gettingstarted.html. I noticed some
references to 1.1 so I thought maybe the PPA was out of date. However
the PyPI version is also 1.1. I'm wary of using non-release git
versions and would prefer to stick with stable releases. Some clarity
here would be greatly appreciated. Do I need to use the git version
just to specify a user for a particular host? Is there no other
workaround?

Also, I'm looking for how to specify a key/ident file, but I can't
find where in the docs there's a comprehensive listing of options like
ansible_ssh_user/ansible_ssh_host/ansible_ssh_port. Closest I could
find is http://ansible.cc/docs/patterns.html which just mentions some
of these in passing. Does a complete listing of options exist?

Thanks for any answers.

I tried the git version anyway. I ran:

$ pip install -e git://github.com/ansible/ansible.git#egg=ansible
...

$ ansible --help
Traceback (most recent call last):
  File "/home/yang/.virtualenvs/ansible/bin/ansible", line 7, in <module>
    execfile(__file__)
  File "/home/yang/.virtualenvs/ansible/src/ansible/bin/ansible", line
155, in <module>
    (options, args) = cli.parse()
  File "/home/yang/.virtualenvs/ansible/src/ansible/bin/ansible", line
57, in parse
    usage='%prog <host-pattern> [options]'
TypeError: base_parser() got an unexpected keyword argument 'check_opts'

Any hints?

Installation instructions are on the documentation site :slight_smile:

1.1 has not yet released. It releases Tuesday and there is no reason
for you to be wary of using it.

I would say 60%+ of people here run from the development branch all of
the time and stay up to date with latest. That's the great thing
about ansible being so easy to run from checkout and having a very
good backwards compatibility track record.

I'm confused. I had already read through the installation
instructions. They say:

Via Pip

Are you a python developer?

Ansible can be installed via Pip, but when you do so, it will ask to install other dependencies used for optional modes:

$ sudo easy_install pip
$ sudo pip install ansible

I had already tried that and it also gave me 1.0, which I mentioned in
my email. If you go look at the PyPI site it just has the 1.0
release. Hence I tried using the git version which failed.

Still stuck on this.

Sorry, I realize in my original email I wrote "the PyPI version is
also 1.1," which doesn't make sense in the context of the other stuff
I had written. I meant to write "is also 1.0."

Anyway, still stuck on this.

1.0 is still the current version in pip.

1.1 is available on github and is releasing Tuesday evening.

github install instructions are on the documentation site.

Thanks, I missed that. You may be aware of this already, but FWIW,
`pip install -e .` from a project source directory with with a
setup.py usually installs the package to the active virtualenv by
referencing the source directories. This is a cleaner/more standard
way of setting things up for development without further mucking with
the user's environment variables. (Doesn't work with current ansible
source, would need to tweak setup.py.)