[I've added the OpenBSD ansible package maintainer to this discussion,
as it's an error in the package. Leaving the discussion on
ansible-project because I have no idea what the proper fix is from
both the OpenBSD and ansible sides.]
> Hi,
>
> I'm running ansible 1.2 on an OpenBSD-current snapshot, from OpenBSD
> packages, and having trouble with ansible_python_interpreter.
>
> BSD systems put python in /usr/local/bin/, which I assume is why . I want to start managing my
> Ubuntu systems. I've added a standalone entry at the top of hosts:
>
> web1.domain.com ansible_python_interpreter=/usr/bin/python
>
> $ ansible -m ping web1.lodden.com
> web1.domain.com | FAILED >> {
> "failed": true,
> "msg": "/bin/sh: /usr/local/bin/python2.7: not found\n",
> "parsed": false
> }
>
That is a bit interesting, my experience has been that OpenBSD
boxes need the extra ansible_python_interpreter for the reasons you
state where linux works out of the box (while using OpenBSD as the
management host).
I have never run ansible from packages though. And to verify I just now
created a host inventory containing a bare ip addrss (.124 is an ubuntu
12.10 host):
192.168.1.124
And:
$ cd git/ansible
$ . hacking/env-setup
$ cd
$ ansible -i <hosts file> -u root -c ssh -m ping 192.168.1.124
... returns a successful result on the Jun 13 snapshot I am running.
The ansible file starts with:
#!/usr/local/bin/python2.7
...
OpenBSD doesn't come with a /usr/bin/python, and it never
will. Neither will any other BSD. The ports don't install a "python"
package, actually: they install a version of python, named after the
version. If the sysadmin wants a plain "python," he picks the version
he wants.
So, will ansible work if it starts with, say, "env python"?
Nice to see more OpenBSD users around here though! (and I just finished
Absolute OpenBSD 2:ed the other day, a really good read
Thanks, glad you liked it.
==ml