The first task is fairly common practice used to allow remote boxes (often legacy / lacking python in base) to execute ansible tasks (ansible’s one requirement is to have python on the target machines). Second task is to avoid having to set ansible_python_interpreter, and definitely isn’t the right way to do it!
I do the exact same thing with every FreeBSD/OpenBSD box I fire up, but I go about it differently:
Then on OpenBSD I have a site.XX.tgz set that installs python (and does various configuration tasks) using autoinstall(8). I don’t use FreeBSD often enough to have an auto-install method for python.
Indeed. The sleep 10 is the bit that had me raise an eyebrow (well, along with the Python symlink). I’ve checked out the other playbooks and in a few cases ansible_python_interpreter is set, but it’s set to /usr/bin/python2.7 (hence the crude FreeBSD hack). Also, checking for the existence of Python before installing might be a good idea…
Thanks for checking out the code. As qbit said, this is a dirty hack due to Ansible only supporting python2 at the moment (python3 is in tech preview and still has bugs). If you have a cleaner way to work around this issue, we are certainly open to considering it. File a bug or make a pull request, we give out bounties! (note: I am one of the authors of Algo)
Algo looks interesting, but the Ansible playbooks it provides do some slightly odd things. For example, in the FreeBSD playbook:
The Ubuntu one does something similar and odd practises are followed throughout. That kind of thing makes me wary.
The first task is fairly common practice used to allow remote boxes (often legacy / lacking python in base) to execute ansible tasks (ansible’s one requirement is to have python on the target machines). Second task is to avoid having to set
ansible_python_interpreter, and definitely isn’t the right way to do it!I do the exact same thing with every FreeBSD/OpenBSD box I fire up, but I go about it differently:
From my ansible hosts:
Then on OpenBSD I have a
site.XX.tgzset that installs python (and does various configuration tasks) using autoinstall(8). I don’t use FreeBSD often enough to have an auto-install method for python.Indeed. The
sleep 10is the bit that had me raise an eyebrow (well, along with the Python symlink). I’ve checked out the other playbooks and in a few casesansible_python_interpreteris set, but it’s set to/usr/bin/python2.7(hence the crude FreeBSD hack). Also, checking for the existence of Python before installing might be a good idea…Easy enough to tidy up though.
Thanks for checking out the code. As qbit said, this is a dirty hack due to Ansible only supporting python2 at the moment (python3 is in tech preview and still has bugs). If you have a cleaner way to work around this issue, we are certainly open to considering it. File a bug or make a pull request, we give out bounties! (note: I am one of the authors of Algo)
Thanks for the response and for creating Algo - I do like the look of it.
I’ve spotted a few things that could (IMHO) be neater (like the symlink) so I’ll take proper browse through and make some suggestions/file PRs.