News for hackers. Stuff that matters.
Re:Command execution on Ansible controller from host by ivank on Thursday January 12, 2017 @03:57AM (#13380846)
https://www.computest.nl/advisories/CT-2017-0109_Ansible.txt has the bug details

Edit: LWN link was changed to this one

Re:Command execution on Ansible controller from host by wvh on Thursday January 12, 2017 @04:35AM (#13380997)
Thanks! Some of those are somewhat embarrassing, especially for something that's meant to be software used in secure environments. Why does a client need to specify an interpreter to run on the master host? Or changing the template brackets to escape quoting? I'm also thinking that maybe Python might be a bit too dynamic – allowing anything by design – bringing its own share of problems to developing security-conscious software.
Re:Command execution on Ansible controller from host by sirn on Thursday January 12, 2017 @05:42AM (#13381270)
> Why does a client need to specify an interpreter to run on the master host?

Some system have Python installed in a rather uncommon location. For example, Python is not part of FreeBSD base system, so Python is installed at /usr/local/bin/python instead of the expected /usr/bin/python, or Arch has Python 2 installed at /usr/bin/python2 rather than /usr/bin/python.

Note that Ansible doesn't require itself to be installed on the remote host (and IMHO is one of its biggest selling point) and execute tasks by sending a packed version of a task to the remote host and execute it using `ansible_python_interpreter` (e.g. `/usr/bin/python /tmp/ansible-tmp-a43bf412.py`)

Re:Command execution on Ansible controller from host by lucd on Thursday January 19, 2017 @10:22PM (#13441535)
Even if you don't have to install a client you have at least to authorize a ssh key and somehow express your intent to add an ansible client.. When in the case of some other solution the installation amounts to one package to deploy (with no dependency) and one command line to issue, installation is a false problem..
Re:Command execution on Ansible controller from host by icebraining on Thursday January 12, 2017 @04:41AM (#13381029)
Why does a client need to specify an interpreter to run on the master host?

No, the client specifies the interpreter to use inside itself.

Re:Command execution on Ansible controller from host by bcoca on Thursday January 12, 2017 @09:01PM (#13387850)
actually, the 'controller' specifies the interpreter to be used at the client, there can be more than 1 and the '1st one in path' is not always the correct one.
Re:Command execution on Ansible controller from host by mkesper on Thursday January 12, 2017 @04:46AM (#13381059)
But why? I think a dedicated interpreter at a fixed address would do.
Re:Command execution on Ansible controller from host by evolvedlight on Thursday January 12, 2017 @04:52AM (#13381091)
Imagine you're in a large enterprise environment, and need to deploy something to lots of different servers that were created by lots of different people (your company bought 3 others and each used different software/linux versions/servers). Some have python in the path, some have different pythons in the path, etc. You can't immediately throw away all these servers and rebuild them - some probably have 10 year old bits of software on them where the original author has moved away. Ansible might be one of the tools you use to start fixing this chaotic situation, and having per-host configurations for things like python path is essential.
Re:Command execution on Ansible controller from host by mkesper on Thursday January 12, 2017 @05:14AM (#13381171)
Step 1: Install the expected, dedicated Python interpreter as /usr/bin/ansible_python.
Re:Command execution on Ansible controller from host by holmb on Thursday January 12, 2017 @05:57AM (#13381324)
Python is not just a single executable. It takes a little more work than one would want. And for what gain? Would you be fine with other software also requiring a custom interpreter to function? It gets cumbersome.
Re:Command execution on Ansible controller from host by mkesper on Thursday January 12, 2017 @10:57AM (#13383206)
If you rely on the system-wide Python you'll need to cover different versions and you need to make sure not to use any 3rd party modules.
Re:Command execution on Ansible controller from host by icebraining on Thursday January 12, 2017 @12:01PM (#13383908)
Ansible ships its own libraries, generally.
Re:Command execution on Ansible controller from host by jubalfh on Thursday January 12, 2017 @09:15AM (#13382303)
Incredibly. But it seems to be The Ruby Way™…
Re:Command execution on Ansible controller from host by jubalfh on Thursday January 12, 2017 @09:17AM (#13382324)
Well, it's an agent-less system after all, the idea is to keep the system lean.
Re:Command execution on Ansible controller from host by bcoca on Friday January 13, 2017 @09:19AM (#13390918)
because it uses existing interpreters on the target host, fixed locations only happen in a homogeneous environment. Most IT shops commonly have to deal different OS/Distrbutions/Versions so the same way you cannot have just 1 tshirt size for everyone you cannot have 1 interpreter path.

I'm saying 'interpreter' instead of Python because you can create modules in any language, Ansible only ships with Python ones, but Perl, Ruby, etc modules exist also and usable by Ansible.

Re:Command execution on Ansible controller from host by witty_username on Thursday January 12, 2017 @04:10AM (#13380904)
Can mods change the link to this?